/* Compact the mobile PDP purchase dock without changing its controls or flow. */
@media only screen and (max-width: 767px) {
    .catalog-product-view .product-secondary-column:not(.product-type-bundle) > .add-to-box {
        padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px)) !important;
        padding-top: 6px !important;
        row-gap: 6px !important;
    }

    /* The legacy clearfix becomes an empty implicit grid row in this dock. */
    .catalog-product-view .product-secondary-column:not(.product-type-bundle) > .add-to-box::after,
    .catalog-product-view .product-secondary-column:not(.product-type-bundle) > .add-to-box > .add-to-cart::after {
        content: none !important;
        display: none !important;
    }

    .catalog-product-view .product-view.azb-mobile-purchase-stacked .product-secondary-column:not(.product-type-bundle) > .add-to-box > .azb-product-addtocart {
        margin-top: 0 !important;
    }
}

/* Narrow phones keep the useful controls together without changing 390px+. */
@media only screen and (max-width: 389px) {
    .catalog-product-view .product-secondary-column:not(.product-type-bundle) > .add-to-box,
    .catalog-product-view .product-view.azb-mobile-purchase-stacked .product-secondary-column:not(.product-type-bundle) > .add-to-box {
        column-gap: 8px !important;
        grid-template-columns: minmax(0, max-content) max-content minmax(84px, 1fr) !important;
        justify-content: stretch !important;
    }

    .catalog-product-view .product-secondary-column:not(.product-type-bundle) > .add-to-box > .price-box,
    .catalog-product-view .product-view.azb-mobile-purchase-stacked .product-secondary-column:not(.product-type-bundle) > .add-to-box > .price-box {
        grid-column: 1 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
        width: auto !important;
    }

    .catalog-product-view .product-secondary-column:not(.product-type-bundle) > .add-to-box .qty-wrapper,
    .catalog-product-view .product-view.azb-mobile-purchase-stacked .product-secondary-column:not(.product-type-bundle) > .add-to-box .qty-wrapper {
        grid-column: 2 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
    }

    .catalog-product-view .product-secondary-column:not(.product-type-bundle) > .add-to-box > .rewards-box,
    .catalog-product-view .product-view.azb-mobile-purchase-stacked .product-secondary-column:not(.product-type-bundle) > .add-to-box > .rewards-box {
        box-sizing: border-box !important;
        align-self: start !important;
        grid-column: 3 !important;
        grid-row: 1 !important;
        height: 40px !important;
        margin: 0 !important;
        min-height: 40px !important;
        min-width: 0 !important;
        overflow: visible !important;
        padding: 0 4px !important;
        width: 100% !important;
    }

    .catalog-product-view .product-secondary-column:not(.product-type-bundle) > .add-to-box > .rewards-box .you_will_earn {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .catalog-product-view .product-secondary-column:not(.product-type-bundle) > .add-to-box > .rewards-box .you_will_earn a,
    .catalog-product-view .product-secondary-column:not(.product-type-bundle) > .add-to-box > .rewards-box .you_will_earn span {
        display: block !important;
        font-size: 10px !important;
        line-height: 12px !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-wrap: anywhere !important;
        white-space: normal !important;
    }

    .catalog-product-view .product-secondary-column:not(.product-type-bundle) > .add-to-box > .azb-product-addtocart,
    .catalog-product-view .product-view.azb-mobile-purchase-stacked .product-secondary-column:not(.product-type-bundle) > .add-to-box > .azb-product-addtocart {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        margin: 0 !important;
        width: 100% !important;
    }
}

/* The confirmation belongs to the purchase flow and must cover support widgets. */
.catalog-product-view .azb-cart-feedback {
    z-index: 1000001 !important;
}
