/* Big Brands B2B — safe shared order cart core */

.bb-order-cart-float,
.bb-order-cart-float * {
    box-sizing: border-box;
}

.bb-order-cart-float {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9000;
    display: inline-grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    max-width: 360px;
    min-width: 260px;
    padding: 12px 14px;
    border-radius: 22px;
    background: linear-gradient(135deg, #111827 0%, #020617 100%);
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 22px 56px rgba(2, 8, 23, .32);
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.bb-order-cart-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 26px 64px rgba(2, 8, 23, .38);
}

.bb-order-cart-float__icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    font-size: 22px;
    line-height: 1;
}

.bb-order-cart-float__label {
    display: block;
    font-size: 12px;
    line-height: 1.15;
    color: #cbd5e1;
    font-weight: 850;
    margin-bottom: 3px;
}

.bb-order-cart-float__summary {
    display: block;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 950;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bb-order-cart-float.is-empty {
    opacity: .88;
}

.bb-order-cart-float.is-empty .bb-order-cart-float__icon {
    background: #475569;
}

@media (max-width: 760px) {
    .bb-order-cart-float {
        left: auto;
        right: 12px;
        bottom: max(14px, env(safe-area-inset-bottom));
        width: min(360px, calc(100vw - 24px));
        max-width: 360px;
        min-width: 0;
        grid-template-columns: 42px minmax(0, 1fr);
        border-radius: 20px;
        padding: 11px 12px;
    }

    .bb-order-cart-float__icon {
        width: 42px;
        height: 42px;
        border-radius: 15px;
    }

    .bb-order-cart-float__summary {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .bb-order-cart-float {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        bottom: max(12px, env(safe-area-inset-bottom));
    }
}

/* Product quantity controls on catalog surfaces */
.bb-card-cart-control,
.bb-card-cart-control * {
    box-sizing: border-box;
}

.bb-card-cart-control {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.bb-card-cart-control__row {
    display: grid;
    grid-template-columns: 42px minmax(72px, 1fr) 42px;
    gap: 6px;
    align-items: center;
}

.bb-card-cart-control__btn,
.bb-card-cart-control__add,
.bb-card-cart-control__input {
    min-height: 42px;
    border-radius: 13px;
    font-size: 15px;
}

.bb-card-cart-control__btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #111827;
    font-size: 22px;
    font-weight: 950;
    line-height: 1;
    cursor: pointer;
}

.bb-card-cart-control__input {
    width: 100%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #111827;
    text-align: center;
    font-weight: 900;
    padding: 0 8px;
}

.bb-card-cart-control__add {
    width: 100%;
    border: 0;
    background: #111827;
    color: #ffffff;
    font-weight: 950;
    cursor: pointer;
}

.bb-card-cart-control__add.is-added {
    background: #15803d;
}

.bb-card-cart-control__note {
    color: #64748b;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.25;
}

.bb-order-product-in-cart {
    border-color: #86efac !important;
    box-shadow: 0 10px 28px rgba(22, 163, 74, .12) !important;
}

.bb-card-cart-control--table {
    min-width: 220px;
    margin-top: 0;
}

.bb-card-cart-control--detail {
    margin: 18px 0 10px;
}

@media (max-width: 760px) {
    .bb-card-cart-control {
        padding: 9px;
        border-radius: 15px;
    }

    .bb-card-cart-control__row {
        grid-template-columns: 44px minmax(72px, 1fr) 44px;
    }

    .bb-card-cart-control__btn,
    .bb-card-cart-control__add,
    .bb-card-cart-control__input {
        min-height: 44px;
    }

    .bb-card-cart-control--table {
        min-width: 0;
    }
}

/* Extra breathing room so the floating cart does not cover the last product cards. */
@media (max-width: 760px) {
    body {
        padding-bottom: max(118px, calc(96px + env(safe-area-inset-bottom)));
    }
}

/* STEP 14 mobile cart overlap fix */
@media (max-width: 760px) {
    /*
      На мобильном нижняя навигация занимает низ экрана.
      Плавающая корзина должна стоять выше неё, а не перекрывать кнопки.
    */
    body {
        padding-bottom: max(214px, calc(196px + env(safe-area-inset-bottom))) !important;
    }

    .bb-order-cart-float.is-empty {
        display: none !important;
    }

    .bb-order-cart-float:not(.is-empty) {
        left: 10px !important;
        right: 10px !important;
        bottom: calc(88px + env(safe-area-inset-bottom)) !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        z-index: 1100 !important;
        border-radius: 22px !important;
    }

    .bb-mobile-bottom {
        z-index: 1090 !important;
    }
}

@media (max-width: 480px) {
    .bb-order-cart-float:not(.is-empty) {
        left: 10px !important;
        right: 10px !important;
        bottom: calc(86px + env(safe-area-inset-bottom)) !important;
    }
}

/* STEP 14.4 quick-order keeps cart link, order-cart hides it */
body.bb-order-cart-page .bb-order-cart-float {
    display: none !important;
}

@media (max-width: 760px) {
    body.quick-order-page .bb-order-cart-float {
        left: 10px !important;
        right: 10px !important;
        bottom: max(6px, env(safe-area-inset-bottom)) !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        min-height: 62px !important;
        padding: 10px 12px !important;
        border-radius: 20px !important;
        grid-template-columns: 44px minmax(0, 1fr) !important;
    }

    body.quick-order-page .bb-order-cart-float__icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 22px !important;
    }

    body.quick-order-page .bb-order-cart-float__label {
        font-size: 13px !important;
        line-height: 1.15 !important;
    }

    body.quick-order-page .bb-order-cart-float__summary {
        font-size: 15px !important;
        line-height: 1.2 !important;
    }

    body.quick-order-page {
        padding-bottom: max(92px, calc(80px + env(safe-area-inset-bottom))) !important;
    }

    body.bb-order-cart-page {
        padding-bottom: 0 !important;
    }
}
/* END STEP 14.4 */
