/*
 * Shared mobile checkout visibility rules for Servermall calculators.
 * Calculator-specific scripts still control pricing, billing, expansion
 * and swipe gestures. This layer only controls when the drawer may appear.
 */

@media (max-width: 991px) {
    /* The site header and burger menu use z-index: 10. */
    .smcalc .smcalc__mini {
        z-index: 9 !important;
    }

    /*
     * Existing calculator scripts add .is-visible when the desktop checkout
     * is outside the viewport. Additionally require the calculator section
     * itself to be visible, so the drawer does not appear at page load.
     */
    .smcalc .smcalc__mini:not(.smcalc__mini--calculator-in-view),
    body.scroll_hidden .smcalc .smcalc__mini,
    .smcalc .smcalc__mini.smcalc__mini--navigation-open {
        transform: translateY(calc(100% + 2rem)) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .smcalc .smcalc__mini.smcalc__mini--calculator-in-view.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Never expose the long summary before the drawer is explicitly opened. */
    .smcalc .smcalc__mini:not(.is-expanded) .smcalc__summary {
        display: none !important;
    }
}
