/* BOC-WEB-004: Global overlay coordination so the cookie notice, floating chat launcher,
   and mobile sticky action bars never collide or cover form inputs / category cards.
   Loaded after lp-uiux-2026-09.css via default_head_blocks.xml. */

/* 1. Compact full-width bottom cookie strip instead of a tall floating left-corner card
   that covers left-column forms (e.g. /semi-custom-cabinets) and homepage style labels. */
html body #notice-cookie-block .cookie {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none !important;
}

html body #notice-cookie-block .cookie > div {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 0.55rem 2.75rem 0.55rem 1rem !important;
    font-size: 0.8125rem;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

html body #notice-cookie-block .cookie button {
    padding: 0.55rem 0.85rem;
    top: 50%;
    transform: translateY(-50%);
}

/* 1b. The strip is full width at every size, so its close button sits under the chat button's corner on desktop
   too. While the strip shows, the chat button and back-to-top stand above it: --boc-lp-bottom-inset is the
   strip's height + 12px (boc-lp-bottom-layers.phtml), unset once it is closed, which leaves both where they
   were. Phones keep the lp-uiux-2026-09.css rules; the homepage has its own offset (home-uiux-2026-09.css C3). */
@media (min-width: 768px) {
    html body:not(.cms-index-index) #boc-chat-launcher {
        bottom: calc(15px + var(--boc-lp-bottom-inset, 0px));
    }

    html body:not(.cms-index-index) #back-to-top {
        bottom: calc(5rem + var(--boc-lp-bottom-inset, 0px));
    }
}

/* 2. On mobile when the semi-custom sticky action bar (.sc-qbar: Call / Text us / Free design)
   is active, dock the cookie strip cleanly above it and hide the redundant floating chat ball
   so three bottom chrome layers never stack over the form. The bar steps aside while a design
   form is on screen (html.sc-form-on, CmsPageEnhancer QBAR_SCRIPT); the chat ball stays hidden
   then too, or it would sit on the form's inputs. */
@media (max-width: 767px) {
    html.sc-qbar-on body #notice-cookie-block .cookie {
        bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
    }

    html.sc-qbar-on body #boc-chat-launcher,
    html.sc-form-on body #boc-chat-launcher {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }

    html body:has([data-paperform-id] iframe:focus) #boc-chat-launcher {
        opacity: 0;
        pointer-events: none;
    }
}
