/**
 * Site side drawers portal — cart + quick-add
 * Loaded after main.css; critical rules also inlined in layout head.
 */

#site-drawers-root {
    position: fixed !important;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10050;
    pointer-events: none;
    overflow: visible;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

#site-drawers-root .cart-overlay,
#site-drawers-root .quick-add-overlay {
    position: absolute !important;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

#site-drawers-root .cart-overlay.active,
#site-drawers-root .quick-add-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#site-drawers-root .cart-drawer,
#site-drawers-root .quick-add-drawer {
    position: absolute !important;
    top: 0;
    bottom: 0;
    display: none !important;
    flex-direction: column;
    max-width: 100%;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    z-index: 2;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

#site-drawers-root .cart-drawer {
    right: 0;
    width: min(360px, 100vw);
}

#site-drawers-root .quick-add-drawer {
    right: 0;
    width: min(440px, 100vw);
}

#site-drawers-root .cart-drawer.active,
#site-drawers-root .quick-add-drawer.active {
    display: flex !important;
    transform: translateX(0);
}

[dir="rtl"] #site-drawers-root .cart-drawer,
[dir="rtl"] #site-drawers-root .quick-add-drawer {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

[dir="rtl"] #site-drawers-root .cart-drawer.active,
[dir="rtl"] #site-drawers-root .quick-add-drawer.active {
    transform: translateX(0);
}

body.cart-open,
body.quick-add-open {
    overflow: hidden;
}

@media screen and (max-width: 575px) {
    #site-drawers-root .cart-drawer,
    #site-drawers-root .quick-add-drawer {
        width: 100%;
    }
}
