#apt :is(.apt-mobile-cart-bar, .apt-mobile-cart-content, .apt-mobile-cart-inner) {
    display: contents;
}

#apt .apt-mobile-cart-toggle {
    display: none;
}

@media (width > 800px) {
    #apt #apt-cart-dock .apt-mobile-cart-bar {
        display: none;
    }
}

@media (max-width: 800px) {
    body > .apt-mobile-cart-anchor {
        position: fixed;
        z-index: 30;
        inset: var(--apt-visible-bottom, auto) 0 0;
        height: 0;
        pointer-events: none;
    }

    body > .apt-mobile-cart-anchor[data-keyboard-open] {
        visibility: hidden;
    }

    .apt-mobile-cart-anchor > .apt-mobile-cart-bar {
        --apt-cart-panel-height: 46px;
        --apt-cart-tab-height: 26px;
        --apt-cart-safe-bottom: env(safe-area-inset-bottom, 0px);
        --apt-cart-glass: #faf8fc;
        --apt-cart-edge: #ded3e5;
        --apt-cart-ink: #201b27;
        --apt-cart-muted: #504357;
        --apt-cart-easing: cubic-bezier(.22, .72, .34, 1);
        position: absolute;
        inset: auto 0 0;
        display: none;
        isolation: isolate;
        box-sizing: border-box;
        padding-bottom: var(--apt-cart-safe-bottom);
        color: var(--apt-cart-ink);
        pointer-events: none;
        transition: grid-template-rows 220ms var(--apt-cart-easing);
    }

    .apt-mobile-cart-anchor > .apt-mobile-cart-bar[data-has-items] {
        display: grid;
        grid-template-rows: var(--apt-cart-tab-height) var(--apt-cart-panel-height);
        animation: apt-mobile-cart-enter 240ms var(--apt-cart-easing);
    }

    .apt-mobile-cart-anchor > .apt-mobile-cart-bar.is-collapsed {
        grid-template-rows: var(--apt-cart-tab-height) 0px;
    }

    body:has(> .apt-mobile-cart-anchor > .apt-mobile-cart-bar[data-has-items]) > #wrapper {
        padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    }

    .apt-mobile-cart-anchor > .apt-mobile-cart-bar::before {
        position: absolute;
        z-index: -1;
        inset: 0;
        content: '';
        border: 1px solid var(--apt-cart-edge);
        border-bottom: 0;
        border-radius: 15px 15px 0 0;
        background: var(--apt-cart-glass);
        box-shadow: inset 0 1px 1px #fff, 0 -4px 18px #26163223;
        transition: opacity 180ms ease-out;
    }

    .apt-mobile-cart-anchor > .apt-mobile-cart-bar::after {
        position: absolute;
        top: calc(var(--apt-cart-tab-height) - 1px);
        inset-inline: 0;
        height: 1px;
        content: '';
        background: linear-gradient(90deg, transparent, #9369a8 30%, #9369a8 70%, transparent);
        opacity: 0;
        transition: opacity 180ms ease-out;
    }

    .apt-mobile-cart-anchor > .apt-mobile-cart-bar.is-collapsed::before {
        opacity: 0;
    }

    .apt-mobile-cart-anchor > .apt-mobile-cart-bar.is-collapsed::after {
        opacity: 1;
    }

    .apt-mobile-cart-bar .apt-mobile-cart-toggle {
        z-index: 1;
        display: grid;
        place-content: center;
        justify-items: center;
        justify-self: center;
        align-self: stretch;
        gap: 2px;
        min-width: 88px;
        min-height: 0;
        margin: 1px 0 0;
        padding: 1px 12px 0;
        border: 1px solid transparent;
        border-radius: 8px;
        background: transparent;
        color: var(--apt-cart-muted);
        box-shadow: none;
        font-size: 11px;
        font-weight: 650;
        line-height: 1.15;
        letter-spacing: 0;
        text-transform: none;
        touch-action: manipulation;
        pointer-events: auto;
        transition: background-color 180ms ease-out, color 180ms ease-out;
    }

    .apt-mobile-cart-bar .apt-mobile-cart-toggle::before {
        content: '';
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        opacity: .7;
    }

    .apt-mobile-cart-bar .apt-mobile-cart-toggle:focus-visible {
        outline: 2px solid #6f167e;
        outline-offset: 2px;
    }

    .apt-mobile-cart-bar.is-collapsed .apt-mobile-cart-toggle {
        min-width: 94px;
        margin-top: 0;
        border-color: var(--ap-accent, #6f167e);
        border-bottom: 0;
        border-radius: 10px 10px 0 0;
        background: var(--ap-accent, #6f167e);
        color: #fff;
    }

    .apt-mobile-cart-bar .apt-mobile-cart-content {
        min-width: 0;
        min-height: 0;
        overflow: hidden;
        transition: opacity 160ms ease-out, visibility 0s;
        pointer-events: auto;
    }

    .apt-mobile-cart-bar.is-collapsed .apt-mobile-cart-content {
        opacity: 0;
        visibility: hidden;
        transition: opacity 160ms ease-out, visibility 0s 220ms;
        pointer-events: none;
    }

    .apt-mobile-cart-bar .apt-cart-link {
        display: grid;
        grid-template-columns: 33px minmax(max-content, 1fr) minmax(0, max-content) 16px;
        grid-template-rows: auto auto;
        grid-template-areas:
            "icon total meta arrow"
            "icon hint  meta arrow";
        align-content: center;
        align-items: center;
        gap: 2px clamp(5px, 2vw, 9px);
        box-sizing: border-box;
        height: var(--apt-cart-panel-height);
        padding: 3px max(12px, env(safe-area-inset-right)) 3px max(12px, env(safe-area-inset-left));
        color: var(--apt-cart-ink);
        text-decoration: none;
        line-height: 1.15;
    }

    .apt-mobile-cart-bar .apt-dock-icon {
        grid-area: icon;
        display: grid;
        place-items: center;
        width: 33px;
        height: 33px;
        border-radius: 8px;
        background: #e6f4ec;
        color: #008744;
        --apt-cart-check: #e6f4ec;
    }

    .apt-mobile-cart-bar .apt-cart-icon {
        width: 25px;
        height: 25px;
    }

    .apt-mobile-cart-bar .apt-dock-details {
        display: contents;
    }

    .apt-mobile-cart-bar .apt-dock-total {
        grid-area: total;
        font-size: clamp(15px, 4.1vw, 18px);
        font-weight: 650;
    }

    .apt-mobile-cart-bar .apt-dock-total :is(.amount, bdi, .woocommerce-Price-currencySymbol) {
        color: inherit;
        font: inherit;
        white-space: nowrap;
    }

    .apt-mobile-cart-bar .apt-cart-link small {
        grid-area: hint;
        color: var(--apt-cart-muted);
        font-size: 10px;
    }

    .apt-mobile-cart-bar .apt-cart-link strong {
        grid-area: meta;
        color: var(--apt-cart-muted);
        font-size: clamp(10px, 3vw, 12px);
        font-weight: 600;
        text-align: right;
    }

    .apt-mobile-cart-bar .apt-dock-arrow {
        grid-area: arrow;
        width: 16px;
        height: 16px;
    }

    @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        .apt-mobile-cart-anchor > .apt-mobile-cart-bar {
            --apt-cart-glass: linear-gradient(142deg, rgb(255 253 255 / 86%), rgb(245 237 250 / 80%));
            --apt-cart-edge: rgb(255 255 255 / 86%);
        }

        .apt-mobile-cart-anchor > .apt-mobile-cart-bar::before {
            -webkit-backdrop-filter: blur(10px) saturate(140%);
            backdrop-filter: blur(10px) saturate(140%);
        }
    }

    @media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
        .apt-mobile-cart-anchor > .apt-mobile-cart-bar {
            --apt-cart-glass: #faf8fc;
            --apt-cart-edge: #cbbbd4;
        }

        .apt-mobile-cart-anchor > .apt-mobile-cart-bar::before {
            -webkit-backdrop-filter: none;
            backdrop-filter: none;
        }
    }

    @keyframes apt-mobile-cart-enter {
        from { transform: translateY(100%); }
    }

    @media (prefers-reduced-motion: reduce) {
        .apt-mobile-cart-anchor > .apt-mobile-cart-bar,
        .apt-mobile-cart-anchor > .apt-mobile-cart-bar[data-has-items],
        .apt-mobile-cart-anchor > .apt-mobile-cart-bar::before,
        .apt-mobile-cart-anchor > .apt-mobile-cart-bar::after,
        .apt-mobile-cart-bar .apt-mobile-cart-toggle,
        .apt-mobile-cart-bar .apt-mobile-cart-content,
        .apt-mobile-cart-bar.is-collapsed .apt-mobile-cart-content {
            animation: none;
            transition: none;
        }
    }
}
