:root {
    --jart-cart-lime: #abcf37;
    --jart-cart-brown: #8e6e5b;
    --jart-cart-brown-hover: #765847;
    --jart-navigation-offset: 112px;
}

/*
 * Lagom rewrites these two properties while its sticky navigation changes
 * state. Keep the layout stable from the first paint and let the small runtime
 * measurement below update only the custom property when the nav height moves.
 */
@media (min-width: 992px) {
    body.lagom-layout-top .app-nav.sticky-navigation {
        position: fixed !important;
        inset: 0 0 auto 0 !important;
        width: 100% !important;
    }

    body.lagom-layout-top main.app-main {
        margin-top: 0 !important;
        padding-top: var(--jart-navigation-offset) !important;
    }
}

@media (max-width: 991.98px) {
    body.lagom-layout-top main.app-main {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

html.jart-cart-drawer-locked,
html.jart-cart-drawer-locked body {
    overflow: hidden !important;
    overscroll-behavior: none;
}

/*
 * The global back-to-top control sits above most overlays. Remove it from the
 * interaction layer while this drawer is open so it cannot cover checkout.
 */
html.jart-cart-drawer-locked #ja-top {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(12px) scale(0.92) !important;
    visibility: hidden !important;
}

#jart-cart-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10980;
    background: rgba(0, 0, 0, 0.34);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity 320ms ease, visibility 0s linear 480ms;
}

#jart-cart-drawer-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

#jart-cart-drawer {
    --jart-cart-bg: #ffffff;
    --jart-cart-surface: #f7f8f5;
    --jart-cart-text: #171817;
    --jart-cart-muted: #626762;
    --jart-cart-border: #dfe4db;
    --jart-cart-focus: #506217;
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 10990;
    width: min(430px, 100vw);
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    color: var(--jart-cart-text);
    background: var(--jart-cart-bg);
    border-left: 1px solid var(--jart-cart-border);
    box-shadow: -30px 0 70px rgba(0, 0, 0, 0);
    transform: translate3d(102%, 0, 0);
    visibility: hidden;
    pointer-events: none;
    contain: layout paint style;
    transition:
        transform 500ms cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 500ms ease,
        visibility 0s linear 500ms;
    will-change: transform;
}

#jart-cart-drawer[data-theme="dark"] {
    --jart-cart-bg: #131713;
    --jart-cart-surface: #1c231c;
    --jart-cart-text: #f7f8f5;
    --jart-cart-muted: #bbc3b9;
    --jart-cart-border: #354034;
    --jart-cart-focus: #abcf37;
}

#jart-cart-drawer.is-open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
    box-shadow: -30px 0 70px rgba(0, 0, 0, 0.22);
    transition-delay: 0s;
}

.jart-cart-drawer-header {
    position: relative;
    z-index: 2;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    background: color-mix(in srgb, var(--jart-cart-bg) 92%, transparent);
    border-bottom: 1px solid var(--jart-cart-border);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.jart-cart-drawer-heading {
    min-width: 0;
}

.jart-cart-drawer-eyebrow {
    display: block;
    margin: 0 0 3px;
    color: #506217;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0;
}

#jart-cart-drawer[data-theme="dark"] .jart-cart-drawer-eyebrow {
    color: var(--jart-cart-lime);
}

#jart-cart-drawer-title {
    margin: 0;
    color: var(--jart-cart-text);
    font-size: 24px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: 0;
}

.jart-cart-drawer-close {
    position: relative;
    isolation: isolate;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--jart-cart-text);
    background: var(--jart-cart-surface);
    border: 1px solid var(--jart-cart-border);
    border-radius: 6px;
    box-shadow: none;
    cursor: pointer;
    transform: translateY(0) scale(1);
    transition:
        transform 360ms cubic-bezier(0.16, 1, 0.3, 1),
        background-color 240ms ease,
        border-color 240ms ease,
        box-shadow 360ms ease;
    will-change: transform;
}

.jart-cart-drawer-close::before,
.jart-cart-drawer-close::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.jart-cart-drawer-close::before {
    inset: -2px;
    z-index: -2;
    border: 2px solid var(--jart-cart-lime);
    border-radius: 9px;
    opacity: 0;
    transform: scale(0.72);
}

.jart-cart-drawer-close::after {
    inset: 4px;
    z-index: -1;
    border-radius: 5px;
    background: color-mix(in srgb, var(--jart-cart-lime) 42%, transparent);
    opacity: 0;
    transform: scale(0.35);
}

.jart-cart-drawer-close-icon {
    position: relative;
    z-index: 1;
    display: block;
    width: 22px;
    height: 22px;
}

.jart-cart-drawer-close-icon::before,
.jart-cart-drawer-close-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 rgba(171, 207, 55, 0);
    transform-origin: center;
}

.jart-cart-drawer-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg) scaleX(1);
}

.jart-cart-drawer-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg) scaleX(1);
}

.jart-cart-drawer-close:hover {
    background: color-mix(in srgb, var(--jart-cart-lime) 18%, var(--jart-cart-surface));
    border-color: color-mix(in srgb, var(--jart-cart-lime) 78%, var(--jart-cart-border));
    box-shadow:
        0 10px 24px color-mix(in srgb, var(--jart-cart-text) 14%, transparent),
        0 0 0 4px color-mix(in srgb, var(--jart-cart-lime) 16%, transparent);
    transform: translateY(-1px) scale(1.1);
}

.jart-cart-drawer-close:hover::before {
    animation: jart-cart-close-ring 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.jart-cart-drawer-close:hover::after {
    animation: jart-cart-close-bloom 640ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.jart-cart-drawer-close:hover .jart-cart-drawer-close-icon::before {
    animation: jart-cart-close-snap-a 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.jart-cart-drawer-close:hover .jart-cart-drawer-close-icon::after {
    animation: jart-cart-close-snap-b 560ms 55ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.jart-cart-drawer-close:active {
    box-shadow: 0 2px 8px color-mix(in srgb, var(--jart-cart-text) 12%, transparent);
    transform: translateY(0) scale(0.96);
    transition-duration: 90ms;
}

@keyframes jart-cart-close-ring {
    0% {
        opacity: 0;
        transform: scale(0.72);
    }
    24% {
        opacity: 0.82;
    }
    100% {
        opacity: 0;
        transform: scale(1.42);
    }
}

@keyframes jart-cart-close-bloom {
    0% {
        opacity: 0;
        transform: scale(0.35);
    }
    38% {
        opacity: 0.62;
        transform: scale(1.08);
    }
    100% {
        opacity: 0;
        transform: scale(1.28);
    }
}

@keyframes jart-cart-close-snap-a {
    0%, 100% {
        box-shadow: 0 0 0 rgba(171, 207, 55, 0);
        transform: translate(-50%, -50%) rotate(45deg) scaleX(1);
    }
    34% {
        box-shadow: 0 0 10px rgba(171, 207, 55, 0.58);
        transform: translate(-50%, -50%) rotate(45deg) scaleX(1.36);
    }
    62% {
        transform: translate(-50%, -50%) rotate(45deg) scaleX(0.86);
    }
}

@keyframes jart-cart-close-snap-b {
    0%, 100% {
        box-shadow: 0 0 0 rgba(171, 207, 55, 0);
        transform: translate(-50%, -50%) rotate(-45deg) scaleX(1);
    }
    34% {
        box-shadow: 0 0 10px rgba(171, 207, 55, 0.58);
        transform: translate(-50%, -50%) rotate(-45deg) scaleX(1.36);
    }
    62% {
        transform: translate(-50%, -50%) rotate(-45deg) scaleX(0.86);
    }
}

.jart-cart-drawer-close:focus-visible,
.jart-cart-drawer-action:focus-visible,
.jart-cart-drawer-shop:focus-visible {
    outline: 3px solid var(--jart-cart-focus) !important;
    outline-offset: 3px;
}

.jart-cart-drawer-body {
    --jart-cart-body-gutter: 22px;
    min-height: 0;
    padding: 8px var(--jart-cart-body-gutter) 24px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--jart-cart-lime) var(--jart-cart-surface);
}

.jart-cart-drawer-body::-webkit-scrollbar {
    width: 10px;
}

.jart-cart-drawer-body::-webkit-scrollbar-track {
    background: var(--jart-cart-surface);
}

.jart-cart-drawer-body::-webkit-scrollbar-thumb {
    background: var(--jart-cart-lime);
    border: 3px solid var(--jart-cart-surface);
    border-radius: 6px;
}

.jart-cart-drawer-status {
    min-height: 100%;
    display: grid;
    place-content: center;
    justify-items: center;
    padding: 44px 18px;
    text-align: center;
}

.jart-cart-drawer-empty-mark {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    color: #34420e;
    background: var(--jart-cart-lime);
    border-radius: 50%;
    font-size: 22px;
    font-weight: 850;
}

.jart-cart-drawer-status h3 {
    margin: 0 0 8px;
    color: var(--jart-cart-text);
    font-size: 20px;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: 0;
}

.jart-cart-drawer-status p {
    max-width: 310px;
    margin: 0 0 22px;
    color: var(--jart-cart-muted);
    font-size: 14px;
    line-height: 1.65;
}

.jart-cart-drawer-shop {
    color: #506217;
    font-size: 14px;
    font-weight: 750;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

#jart-cart-drawer[data-theme="dark"] .jart-cart-drawer-shop {
    color: var(--jart-cart-lime);
}

.jart-cart-drawer-list {
    margin: 0 calc(var(--jart-cart-body-gutter) * -1);
    padding: 0;
    list-style: none;
}

.jart-cart-drawer-item {
    position: relative;
    display: block;
    padding: 0;
    border-bottom: 1px solid var(--jart-cart-border);
    overflow: hidden;
    animation: jart-cart-item-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.jart-cart-drawer-item::before {
    content: "";
    position: absolute;
    top: 24px;
    left: 0;
    z-index: 4;
    width: 4px;
    height: 30px;
    background: var(--jart-cart-lime);
    border-radius: 0 4px 4px 0;
}

.jart-cart-drawer-item-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 22px calc(var(--jart-cart-body-gutter) + 4px) 22px calc(var(--jart-cart-body-gutter) + 14px);
    background: var(--jart-cart-bg);
    touch-action: pan-y;
    transform: translate3d(var(--jart-cart-swipe-x, 0), 0, 0);
    transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), opacity 180ms ease;
    will-change: transform;
}

.jart-cart-drawer-item.is-swiping .jart-cart-drawer-item-content {
    transition: none;
}

.jart-cart-drawer-swipe-action {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 1;
    width: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #ffffff;
    background: #7d3a31;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    pointer-events: none;
    transition: background-color 180ms ease;
}

.jart-cart-drawer-swipe-action i {
    font-size: 18px;
    line-height: 1;
    transform: scale(0.9);
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.jart-cart-drawer-item.is-swipe-ready .jart-cart-drawer-swipe-action {
    background: #9b473a;
}

.jart-cart-drawer-item.is-swipe-ready .jart-cart-drawer-swipe-action i {
    transform: scale(1.08);
}

.jart-cart-drawer-item-copy {
    min-width: 0;
}

.jart-cart-drawer-item-name {
    display: block;
    overflow-wrap: anywhere;
    color: var(--jart-cart-text);
    font-size: 15px;
    font-weight: 750;
    line-height: 1.4;
}

.jart-cart-drawer-item-type {
    display: block;
    margin-top: 4px;
    color: var(--jart-cart-muted);
    font-size: 13px;
    line-height: 1.45;
}

.jart-cart-drawer-item-price {
    color: var(--jart-cart-text);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.4;
    white-space: nowrap;
}

.jart-cart-drawer-item-actions {
    align-self: start;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.jart-cart-drawer-item-remove {
    position: relative;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: #6b2d2d;
    background: #fff7f5;
    border: 1px solid #e5cbc5;
    border-radius: 6px;
    box-shadow: none;
    cursor: pointer;
    transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 220ms ease,
        transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.jart-cart-drawer-item-remove i {
    font-size: 16px;
    line-height: 1;
    transition: opacity 160ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.jart-cart-drawer-item-remove:hover {
    color: #ffffff;
    background: #8b3f35;
    border-color: #8b3f35;
    box-shadow: 0 8px 20px rgba(107, 45, 45, 0.2);
    transform: scale(1.06);
}

.jart-cart-drawer-item-remove:focus-visible {
    outline: 3px solid var(--jart-cart-focus) !important;
    outline-offset: 2px !important;
}

.jart-cart-drawer-item-remove:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.jart-cart-drawer-item-remove.is-loading i {
    opacity: 0;
    transform: scale(0.65);
}

.jart-cart-drawer-item-remove.is-loading::after {
    content: "";
    position: absolute;
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: jart-cart-remove-spin 700ms linear infinite;
}

.jart-cart-drawer-item.is-removing .jart-cart-drawer-item-content {
    opacity: 0.58;
}

.jart-cart-drawer-item-remove-error {
    grid-column: 1 / -1;
    margin-top: -2px;
    color: #8b3f35;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.4;
}

#jart-cart-drawer[data-theme="dark"] .jart-cart-drawer-item-remove {
    color: #ffcdc3;
    background: #2c1c1a;
    border-color: #68433d;
}

#jart-cart-drawer[data-theme="dark"] .jart-cart-drawer-item-remove:hover {
    color: #ffffff;
    background: #a64e40;
    border-color: #c66a5b;
}

#jart-cart-drawer[data-theme="dark"] .jart-cart-drawer-item-remove-error {
    color: #ffb5a8;
}

@keyframes jart-cart-remove-spin {
    to { transform: rotate(360deg); }
}

.jart-cart-drawer-footer {
    position: relative;
    z-index: 2;
    padding: 18px 22px max(18px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--jart-cart-bg) 94%, transparent);
    border-top: 1px solid var(--jart-cart-border);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.jart-cart-drawer-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.jart-cart-drawer-total-label {
    color: var(--jart-cart-muted);
    font-size: 13px;
    font-weight: 650;
}

.jart-cart-drawer-total-value {
    color: var(--jart-cart-text);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.2;
    text-align: right;
}

.jart-cart-drawer-action {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 20px;
    color: #ffffff !important;
    background: var(--jart-cart-brown);
    border: 1px solid var(--jart-cart-brown);
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(84, 71, 65, 0.18);
    font-size: 15px;
    font-weight: 750;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.jart-cart-drawer-action:hover {
    color: #ffffff !important;
    background: var(--jart-cart-brown-hover);
    border-color: var(--jart-cart-brown-hover);
    box-shadow: 0 12px 28px rgba(84, 71, 65, 0.24);
    transform: translateY(-1px);
}

.jart-cart-drawer-loading {
    display: grid;
    gap: 12px;
    padding: 26px 0;
}

.jart-cart-drawer-skeleton {
    position: relative;
    height: 66px;
    margin: 0;
    background: transparent;
    border: 1px solid var(--jart-cart-border);
    border-radius: 12px;
    box-shadow: none;
    overflow: hidden;
}

.jart-cart-drawer-skeleton::before,
.jart-cart-drawer-skeleton::after {
    content: "";
    position: absolute;
    top: 50%;
    opacity: 0;
    pointer-events: none;
    will-change: left, opacity;
}

.jart-cart-drawer-skeleton::before {
    left: -82%;
    width: 74%;
    height: 42px;
    background:
        linear-gradient(90deg, rgba(120, 149, 42, 0.04), rgba(142, 181, 47, 0.22) 32%, rgba(171, 207, 55, 0.62) 70%, #c8e96c 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 46%, rgba(120, 149, 42, 0.1));
    filter: drop-shadow(0 0 6px rgba(171, 207, 55, 0.18));
    transform: translateY(-50%);
    -webkit-mask-image:
        repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 8px),
        repeating-linear-gradient(0deg, #000 0 5px, transparent 5px 8px),
        linear-gradient(90deg, transparent, #000 24%, #000 100%);
    -webkit-mask-composite: source-in, source-in;
    mask-image:
        repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 8px),
        repeating-linear-gradient(0deg, #000 0 5px, transparent 5px 8px),
        linear-gradient(90deg, transparent, #000 24%, #000 100%);
    mask-composite: intersect;
    animation: jart-cart-ultracode-trail 4.8s cubic-bezier(0.42, 0, 0.18, 1) infinite;
}

.jart-cart-drawer-skeleton::after {
    left: -42px;
    width: 36px;
    height: 48px;
    background: linear-gradient(135deg, #e7f5b5 0%, #b9dc4f 46%, #8eb52f 100%);
    border: 1px solid rgba(126, 158, 39, 0.32);
    border-radius: 12px;
    box-shadow:
        -8px 0 18px rgba(171, 207, 55, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transform: translateY(-50%);
    animation: jart-cart-ultracode-head 4.8s cubic-bezier(0.42, 0, 0.18, 1) infinite;
}

#jart-cart-drawer[data-theme="dark"] .jart-cart-drawer-skeleton {
    background: transparent;
    border-color: var(--jart-cart-border);
}

@keyframes jart-cart-ultracode-trail {
    0% {
        opacity: 0;
        left: -82%;
    }
    16% {
        left: -74%;
        opacity: 0.72;
    }
    78% {
        left: 26%;
        opacity: 1;
    }
    92% {
        left: 62%;
        opacity: 0.7;
    }
    100% {
        opacity: 0;
        left: 105%;
    }
}

@keyframes jart-cart-ultracode-head {
    0% {
        opacity: 0;
        left: -42px;
    }
    16% {
        left: -1%;
        opacity: 1;
    }
    78% {
        left: calc(100% - 35px);
        opacity: 1;
    }
    92% {
        left: calc(100% + 12px);
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        left: calc(100% + 42px);
    }
}

@keyframes jart-cart-item-in {
    from { opacity: 0; transform: translateX(14px); }
    to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 479px) {
    #jart-cart-drawer {
        width: 100vw;
        border-left: 0;
    }

    .jart-cart-drawer-header {
        min-height: 74px;
        padding: 14px 16px;
    }

    .jart-cart-drawer-body,
    .jart-cart-drawer-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .jart-cart-drawer-body {
        --jart-cart-body-gutter: 16px;
    }

}

@media (prefers-reduced-motion: reduce) {
    #jart-cart-drawer,
    #jart-cart-drawer-backdrop,
    .jart-cart-drawer-close,
    .jart-cart-drawer-close::before,
    .jart-cart-drawer-close::after,
    .jart-cart-drawer-close-icon::before,
    .jart-cart-drawer-close-icon::after,
    .jart-cart-drawer-action,
    .jart-cart-drawer-item,
    .jart-cart-drawer-item-content,
    .jart-cart-drawer-swipe-action,
    .jart-cart-drawer-swipe-action i,
    .jart-cart-drawer-item-remove,
    .jart-cart-drawer-item-remove i,
    .jart-cart-drawer-skeleton::before,
    .jart-cart-drawer-skeleton::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .jart-cart-drawer-close:hover,
    .jart-cart-drawer-close:active {
        transform: none !important;
    }

    .jart-cart-drawer-skeleton::before {
        filter: none !important;
        left: 6% !important;
        opacity: 0.72 !important;
    }

    .jart-cart-drawer-skeleton::after {
        filter: none !important;
        left: calc(80% - 35px) !important;
        opacity: 1 !important;
    }
}
