:root { --ac-cart-w: clamp(320px, 32vw, 384px); }

.ac-cart-drawer { display: none; }

@media (min-width: 1024px) {
    body { transition: padding-right .35s cubic-bezier(.4, 0, .2, 1); }

    .ac-cart-drawer {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 90000;
        display: flex;
        flex-direction: column;
        width: var(--ac-cart-w);
        height: 100dvh;
        background: #fff;
        color: #071c38;
        border-left: 1px solid #dde9f2;
        box-shadow: -18px 0 48px #071c3826;
        transform: translateX(101%);
        visibility: hidden;
        transition: transform .35s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .35s;
    }
    html.ac-cart-open .ac-cart-drawer { transform: none; visibility: visible; transition: transform .35s cubic-bezier(.4, 0, .2, 1); }
    body.admin-bar .ac-cart-drawer { top: 32px; height: calc(100dvh - 32px); }
}

/* Narrow desktops cannot absorb the shift without clipping the nav; overlay there. */
@media (min-width: 1400px) {
    html.ac-cart-open body { padding-right: var(--ac-cart-w); }
}

.ac-cd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e3edf4; }
.ac-cd-head h2 { display: flex; align-items: baseline; gap: 6px; margin: 0; font-size: 18px; line-height: 1.3; color: #071c38; }
.ac-cd-count { font-size: 13px; font-weight: 400; color: #65788a; }
.ac-cd-close { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid #dbe7f1; border-radius: 6px; background: #fff; color: #27455f; cursor: pointer; }
.ac-cd-close:hover { background: #eef7fc; }
.ac-cd-close:focus-visible { outline: 2px solid #009ed5; outline-offset: 2px; }

.ac-cart-drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 20px 16px; }
.ac-cd-items { margin: 0; padding: 0; list-style: none; }
.ac-cd-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid #eef4f8; }
.ac-cd-item.is-busy { opacity: .5; pointer-events: none; }
.ac-cd-thumb img { width: 64px; height: 64px; object-fit: contain; background: #f6fbfe; border-radius: 6px; }
.ac-cd-copy { min-width: 0; }
.ac-cd-name { margin: 0; font-size: 13.5px; line-height: 1.35; font-weight: 600; }
.ac-cd-name a { color: #071c38; text-decoration: none; }
.ac-cd-name a:hover { color: #007ea9; }
.ac-cd-copy dl.variation { display: flex; flex-wrap: wrap; gap: 2px 6px; margin: 4px 0 0; font-size: 11px; color: #5b7183; }
.ac-cd-copy dl.variation dt { font-weight: 400; }
.ac-cd-copy dl.variation dd { margin: 0; }
.ac-cd-unit { margin: 5px 0 0; font-size: 12px; color: #42586b; }
.ac-cd-side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.ac-cd-qty { display: inline-flex; align-items: stretch; border: 1px solid #cfe1ec; border-radius: 6px; overflow: hidden; }
.ac-cd-qty button { width: 28px; padding: 0; border: 0; background: #f2f8fc; color: #0f4665; font-size: 15px; line-height: 1; cursor: pointer; }
.ac-cd-qty button:hover { background: #e2f1fa; }
.ac-cd-qty input { width: 36px; border: 0; border-left: 1px solid #dceaf4; border-right: 1px solid #dceaf4; padding: 5px 0; text-align: center; font-size: 13px; font-weight: 700; color: #09264b; -moz-appearance: textfield; }
.ac-cd-qty input::-webkit-outer-spin-button,
.ac-cd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ac-cd-line { margin: 0; font-size: 13px; font-weight: 700; }
.ac-cd-remove { padding: 0; border: 0; background: none; color: #8a9bab; font-size: 11px; text-decoration: underline; cursor: pointer; }
.ac-cd-remove:hover { color: #c0392b; }
.ac-cd-totals { display: grid; gap: 6px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid #e3edf4; }
.ac-cd-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; }
.ac-cd-totals dt { color: #3d5468; }
.ac-cd-totals dd { margin: 0; font-weight: 700; white-space: nowrap; }
.ac-cd-fee dt, .ac-cd-fee dd { font-size: 13px; color: #1f7a4d; }
.ac-cd-ship { margin: 8px 0 14px; font-size: 11px; color: #6b7f90; }
.ac-cd-checkout { display: block; padding: 13px; border-radius: 6px; background: #123d65; color: #fff; font-size: 14px; font-weight: 700; text-align: center; text-decoration: none; }
.ac-cd-checkout:hover { background: #0d2f50; color: #fff; }
.ac-cd-view { display: block; margin-top: 9px; font-size: 12px; color: #007ea9; text-align: center; }
.ac-cd-empty { padding: 48px 0 24px; text-align: center; }
.ac-cd-empty p { margin: 0 0 16px; font-size: 14px; color: #42586b; }
.ac-cd-continue { display: inline-block; padding: 11px 22px; border-radius: 6px; background: #009ed5; color: #fff !important; font-size: 13px; font-weight: 700; text-decoration: none; }
.ac-cd-error { margin: 0; padding: 10px 20px; border-top: 1px solid #f1d5d2; background: #fdf3f2; color: #b03a2e; font-size: 12px; }

.ac-cart-drawer.is-updating .ac-cart-drawer-body { pointer-events: none; }

.ac-cart-status { display: block; margin-top: 6px; font-size: 12px; line-height: 1.5; color: #4b5f73; }
.ac-cart-status:empty { display: none; }
.ac-cart-status a { color: #007ea9; text-decoration: underline; }

.ac-showcase-form .ac-cart-status:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
    body, .ac-cart-drawer { transition: none !important; }
}
