.as-winter-cart-frost {
    display: none;
}

html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty {
    --as-winter-cart-cold-background: rgba(186, 211, 249, 0.10);
    --as-winter-cart-cold-border: rgba(188, 207, 240, 0.26);
    --as-winter-cart-chill-duration: 250ms;
    --as-winter-cart-frost-delay: calc(var(--as-winter-cart-open-delay, 0ms) + var(--as-winter-cart-chill-duration));
    position: relative;
    isolation: isolate;
    animation: as-winter-cart-cool var(--as-winter-cart-chill-duration) ease-out var(--as-winter-cart-open-delay, 0ms) both;
}

html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty > .as-winter-cart-frost {
    display: block;
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
}

.as-winter-cart-frost::before,
.as-winter-cart-frost::after {
    content: "";
    position: absolute;
    width: 80px;
    height: 50px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    animation: as-winter-cart-crystallize 500ms ease-out var(--as-winter-cart-frost-delay) both;
}

.as-winter-cart-frost::before {
    top: 0;
    left: 0;
    background-image: url("assets/frost-rim-top-left.svg");
    --as-winter-cart-frost-origin: left top;
}

.as-winter-cart-frost::after {
    bottom: 0;
    right: 0;
    background-image: url("assets/frost-rim-bottom-right.svg");
    --as-winter-cart-frost-origin: right bottom;
}

@media (max-width: 768px) {
    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty {
        position: fixed;
        /* Let the mobile panel's opening transition finish before it cools. */
        --as-winter-cart-open-delay: 250ms;
    }

    .as-ajax--mc-wrapper:not(.as-ajax--mc-wrapper--open) > .as-winter-cart-ready.as-ajax--mc-panel--empty {
        animation: none;
    }

    .as-ajax--mc-wrapper:not(.as-ajax--mc-wrapper--open) > .as-winter-cart-ready.as-ajax--mc-panel--empty > .as-winter-cart-frost {
        display: none;
    }
}

@media (min-width: 769px) {
    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty::before,
    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty::after {
        --as-winter-cart-icicle-delay: calc(var(--as-winter-cart-frost-delay) + 180ms);
        content: "";
        position: absolute;
        inset-block-start: calc(100% - 1px);
        width: 50%;
        height: 45px;
        background: url("assets/cart-icicles.svg?v=2") left top / 200% 100% no-repeat;
        transform-origin: 50% top;
        pointer-events: none;
        animation: as-winter-cart-ice-grow 570ms ease-out var(--as-winter-cart-icicle-delay) both;
    }

    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty::before {
        inset-inline-start: 0;
    }

    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty::after {
        inset-inline-end: 0;
        background-position: right top;
        animation-delay: calc(var(--as-winter-cart-icicle-delay) + 45ms);
    }
}

@keyframes as-winter-cart-cool {
    to {
        background-color: var(--as-winter-cart-cold-background);
        border-color: var(--as-winter-cart-cold-border);
    }
}

@keyframes as-winter-cart-crystallize {
    from {
        clip-path: circle(14px at var(--as-winter-cart-frost-origin));
        opacity: 0;
    }

    45% {
        opacity: 0.78;
    }

    to {
        clip-path: circle(96px at var(--as-winter-cart-frost-origin));
        opacity: 1;
    }
}

@keyframes as-winter-cart-ice-grow {
    from {
        opacity: 0;
        transform: scaleY(0.12);
    }

    40% {
        opacity: 0.76;
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty {
        background-color: var(--as-winter-cart-cold-background);
        border-color: var(--as-winter-cart-cold-border);
        animation: none;
    }

    .as-winter-cart-frost::before,
    .as-winter-cart-frost::after,
    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty::before,
    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty::after {
        animation: none;
    }
}

@media (forced-colors: active) {
    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty {
        animation: none;
    }

    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty > .as-winter-cart-frost {
        display: none;
    }

    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty::before,
    html.as-winter-season-active .as-winter-cart-ready.as-ajax--mc-panel--empty::after {
        content: none;
    }
}
