@media (max-width: 767px) {
    body.blotto-has-mobile-checkout-bar {
        padding-bottom: 96px !important;
    }

    /*
     * Keep the Cart action bar available while customers type. Some mobile
     * browsers retain focus after the virtual keyboard closes, which made the
     * legacy input-active hiding rule leave the bar hidden.
     */
    body.blotto-commerce-input-active .blotto-mobile-checkout-bar {
        display: grid !important;
    }

    .blotto-mobile-checkout-bar {
        grid-template-columns: minmax(128px, .82fr) minmax(150px, 1fr);
        gap: 12px;
        padding-top: 9px;
        padding-bottom: calc(9px + env(safe-area-inset-bottom));
    }

    .blotto-mobile-checkout-summary {
        min-width: 0;
    }

    .blotto-mobile-checkout-total {
        display: flex;
        align-items: baseline;
        gap: 7px;
        min-width: 0;
    }

    .blotto-mobile-checkout-total small,
    .blotto-mobile-checkout-total strong {
        display: block;
        white-space: nowrap;
    }

    .blotto-mobile-checkout-total strong {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .blotto-mobile-checkout-shipping {
        display: block;
        margin-top: 3px;
        overflow: hidden;
        color: #5f5257;
        font-size: 11px;
        font-weight: 650;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .blotto-mobile-checkout-shipping[data-shipping-type="free"] {
        color: #18743b;
    }

    .blotto-mobile-checkout-shipping[data-shipping-type="paid"] {
        color: #9f3f25;
    }

    .blotto-mobile-checkout-bar .checkout-button {
        min-width: 0;
        min-height: 50px !important;
        padding-right: 16px !important;
        padding-left: 16px !important;
        font-size: 15px !important;
    }
}

@media (max-width: 359px) {
    .blotto-mobile-checkout-bar {
        grid-template-columns: minmax(116px, .8fr) minmax(136px, 1fr);
        gap: 8px;
        padding-right: max(10px, env(safe-area-inset-right));
        padding-left: max(10px, env(safe-area-inset-left));
    }

    .blotto-mobile-checkout-total {
        gap: 5px;
    }

    .blotto-mobile-checkout-bar strong {
        font-size: 17px;
    }
}

/* Keep paid products and free gifts in one inventory-row system. */
body.blotto-commerce-ui form.woocommerce-cart-form table.shop_table > tbody > tr.blotto-free-gift-row {
    background: #fff !important;
    box-shadow: var(--blotto-inventory-shadow, 0 7px 20px rgba(75, 42, 53, .07)) !important;
}

body.blotto-commerce-ui form.woocommerce-cart-form .blotto-free-gift-row .product-name {
    color: #3f3035;
}

body.blotto-commerce-ui form.woocommerce-cart-form .blotto-free-gift-row .product-name::before {
    border: 1px solid #cfe9d7;
    background: #eef9f1;
}

body.blotto-commerce-ui form.woocommerce-cart-form .blotto-free-gift-row .blotto-gift-free-price {
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-size: 15px;
    line-height: 1.3;
}

@media (max-width: 767px) {
    body.blotto-commerce-ui form.woocommerce-cart-form table.shop_table > tbody > tr.blotto-free-gift-row {
        box-shadow: var(--blotto-inventory-shadow, 0 7px 20px rgba(75, 42, 53, .07)) !important;
    }

    body.blotto-commerce-ui form.woocommerce-cart-form .blotto-free-gift-row .product-name {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 7px;
    }

    body.blotto-commerce-ui form.woocommerce-cart-form .blotto-free-gift-row .product-name::before {
        width: max-content;
        margin: 0 !important;
    }
}
