/* PASS 083 — inner sticky alignment, drawer geometry, 3-col related.
   Does NOT change desktop sticky max-width / docking animation (PASS 080–081). */

/* Direct children of the bar only — never the drawer .navbar-brand. */
@media (max-width: 991.98px) {
    header.header nav.nav > .nav-container.bottom > .nav-mobile-phone,
    header.header.inner nav.nav > .nav-container.bottom > .nav-mobile-phone {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        justify-self: center !important;
        z-index: 2;
        position: relative;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        pointer-events: auto;
    }
    header.header nav.nav > .nav-container.bottom > .nav-toggler,
    header.header.inner nav.nav > .nav-container.bottom > .nav-toggler {
        grid-column: 1 !important;
        grid-row: 2 !important;
        justify-self: start !important;
        z-index: 2;
        position: relative;
    }
    header.header nav.nav > .nav-container.bottom > .navbar-brand,
    header.header.inner nav.nav > .nav-container.bottom > .navbar-brand {
        grid-column: 2 !important;
        grid-row: 2 !important;
        justify-self: center !important;
        z-index: 2;
        position: relative;
        margin: 0 !important;
        width: max-content !important;
        min-width: 45px;
        min-height: 40px;
        display: flex !important;
        align-items: center;
        overflow: visible;
    }
    header.header nav.nav > .nav-container.bottom > .navbar-brand a,
    header.header.inner nav.nav > .nav-container.bottom > .navbar-brand a {
        display: inline-flex !important;
        margin: 0 !important;
        width: auto !important;
    }
    header.header nav.nav > .nav-container.bottom > .navbar-brand img,
    header.header.inner nav.nav > .nav-container.bottom > .navbar-brand img {
        width: 45px !important;
        max-width: 45px !important;
        height: auto !important;
        display: block !important;
        opacity: 1 !important;
    }
    header.header nav.nav > .nav-container.bottom > .nav-search,
    header.header.inner nav.nav > .nav-container.bottom > .nav-search {
        grid-column: 3 !important;
        grid-row: 2 !important;
        justify-self: end !important;
        z-index: 2;
        position: relative;
    }
    header.header nav.nav > .nav-container.bottom > .nav-inner,
    header.header.inner nav.nav > .nav-container.bottom > .nav-inner {
        grid-column: 1 / -1;
        grid-row: auto;
    }
}

/* Drawer: full-height panel, header separated from list, overlay full viewport. */
@media (max-width: 991.98px) {
    html.overflow-hidden,
    html.ap-nav-locked,
    body.ap-nav-locked {
        overflow-x: hidden !important;
        overflow-y: hidden !important;
        padding-inline-end: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    html.ap-nav-locked,
    html.overflow-hidden {
        overflow: hidden !important;
    }
    #overlayer.show {
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 100dvh;
        margin: 0 !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 350 !important;
    }
    header.header nav.nav.ap-drawer-open > .nav-container .nav-inner.open,
    header.header nav.nav > .nav-container .nav-inner.open {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        width: min(86vw, 300px) !important;
        background: #fff !important;
        color: #181818;
        display: flex !important;
        flex-direction: column !important;
        overflow-x: hidden;
        overflow-y: auto;
        box-sizing: border-box;
        transform: none !important;
        z-index: 410 !important;
    }
    header.header .nav-inner .nav-mobile-close-row,
    header.header .nav-inner .nav-mobile-header {
        position: relative !important;
        top: auto !important;
        flex: 0 0 auto;
        background: #fff;
        z-index: 3;
        padding-bottom: 0.85rem !important;
        min-height: 3.25rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        overflow: visible;
    }
    header.header .nav-inner .nav-mobile-header .navbar-brand {
        grid-column: auto !important;
        grid-row: auto !important;
        width: auto !important;
        margin: 0 auto !important;
        justify-self: center;
    }
    header.header nav.nav > .nav-container .nav-inner.open > ul {
        flex: 1 1 auto;
        margin-top: 0.75rem !important;
        padding-top: 0.75rem !important;
        transform: none !important;
        opacity: 1 !important;
        position: relative;
        z-index: 1;
        clear: both;
    }
}

/* Related products: restore compiled 3-col desktop (base 33.33%; 50% only ≤768px). */
@media (min-width: 769px) {
    .product-detail .products-list .item,
    .product-single .products-list .item,
    main .mt-5 > .products-list .item {
        flex: 0 0 33.333% !important;
        width: 33.333% !important;
        max-width: 33.333% !important;
        padding: 0.5rem 0.4rem !important;
        box-sizing: border-box;
    }
}

.ap-oa-space--quick {
    grid-template-columns: auto minmax(7rem, 1fr);
}
.ap-oa-space-label {
    font-weight: 600;
    white-space: nowrap;
    align-self: center;
}
.ap-oa-space--detailed {
    grid-template-columns: minmax(6rem, 1fr) minmax(6rem, 1fr) auto;
}
.ap-oa-total {
    margin: 0.35rem 0 0.6rem;
    padding: 0.4rem 0.55rem;
    background: #f6f6f6;
    border-radius: 6px;
    font-size: 0.92rem;
}
.ap-oa-space-remove {
    min-width: 2rem;
}
