/**
 * Placement override for the third-party Call Now Button plugin's
 * "Book Table" button (dev/prod server plugin — not bundled here).
 *
 * CNB's `mright` appearance pins the button vertically centered on the
 * right edge (top:50%; margin-top:-28px; right:20px), floating over page
 * content. We re-pin it to the bottom-right, directly ABOVE the floating
 * order/cart cluster: the Chaty "Order Now" CTA (bottom 25) and the cart
 * FAB [data-gordon-cart-fab] (bottom 24, ~60px tall).
 *
 * The id selector outweighs CNB's .cnb-single.cnb-mright rule without
 * !important, and is inert on environments where the plugin is absent.
 * z-index stays CNB's own (10), so the SPA cart drawer/modals (99998+)
 * still cover the button when open. The expanded Chaty channel list may
 * temporarily overlap it — accepted, it closes back cleanly.
 */
#callnowbutton.cnb-mright {
    top: auto;
    margin-top: 0;
    bottom: 96px; /* cart FAB top edge (24 + 60) + 12px gap */
    right: 24px;  /* right-aligned with the cart FAB */
}

/*
 * Hide the button while an SPA overlay is open. The SPA's modals/drawer set
 * z-index 99999+, but they render inside a page wrapper whose stacking
 * context is below body-level children, so the CNB anchor (a direct body
 * child) paints ON TOP of them — at the new bottom-right position it would
 * cover the modal's Add to Cart / Buy Now footer. The overlay roots are
 * conditionally mounted (unmounted when closed), so :has() doubles as an
 * "is open" check. Covered roots: product modals (#customizeModal,
 * #halfHalfModal), Tailwind-styled modals (NonPizza/Customization share the
 * !z-[99999] root class), the cart drawer, and the store selector.
 */
body:has(#customizeModal) #callnowbutton,
body:has(#halfHalfModal) #callnowbutton,
body:has([data-gordon-cart-drawer]) #callnowbutton,
body:has([data-testid="store-selector-modal"]) #callnowbutton,
body:has([class*="!z-[99999]"]) #callnowbutton {
    display: none;
}
