/* doc-project | public/assets/css/shared-cart-intro.css | notice persistante et fermeture accessible du QR partagé */
.shared-cart-intro {
    position: relative;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
    align-items: center;
    gap: clamp(1rem, 4vw, 2rem);
    width: min(1120px, calc(100% - 2rem));
    box-sizing: border-box;
    margin: 0 auto 1rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    overflow: visible;
    border: 1px solid rgba(111, 74, 168, .28);
    border-radius: 20px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 16px 44px rgba(48, 30, 73, .14);
}

.shared-cart-intro[hidden] {
    display: none;
}

.shared-cart-intro__copy {
    min-width: 0;
}

.shared-cart-intro__copy h2 {
    margin: .15rem 0 .45rem;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.shared-cart-intro__copy p {
    max-width: 48rem;
    margin: 0 0 .85rem;
    color: #4e287f;
    font-family:
        "Segoe Print",
        "Bradley Hand",
        "Comic Sans MS",
        cursive;
    font-size: clamp(1.45rem, 4vw, 2.55rem);
    font-weight: 700;
    line-height: 1.25;
}

.shared-cart-intro__copy .button:focus-visible {
    outline: 4px solid rgba(116, 80, 165, .22);
    outline-offset: 3px;
}

.shared-cart-intro__qr {
    position: relative;
    z-index: 2;
    display: grid;
    width: min(100%, 220px);
    aspect-ratio: 1;
    justify-self: end;
    place-items: center;
    box-sizing: border-box;
    overflow: hidden;
    border: 8px solid #fff;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(38, 24, 57, .16);
    transform-origin: center;
}

.shared-cart-intro__qr[data-state="error"] {
    min-height: 112px;
    aspect-ratio: auto;
    padding: .75rem;
    border-color: #f3e8cf;
    background: #fff8e8;
}

.shared-cart-intro__qr img,
.shared-cart-intro__qr canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.shared-cart-intro__qr.is-docking {
    animation: shared-cart-qr-dock 900ms cubic-bezier(.22, .8, .25, 1) forwards;
    will-change: opacity, transform;
}

.shared-cart-intro.is-closing {
    animation: shared-cart-intro-close 420ms ease 480ms forwards;
    pointer-events: none;
    will-change: opacity, transform;
}

@keyframes shared-cart-qr-dock {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    78% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform:
            translate(var(--shared-cart-dock-x, 0), var(--shared-cart-dock-y, -40px))
            scale(.18);
    }
}

@keyframes shared-cart-intro-close {
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@media (max-width: 620px) {
    .shared-cart-intro {
        grid-template-columns: minmax(0, 1fr) 128px;
        align-items: start;
        width: calc(100% - 20px);
        gap: .8rem;
        padding: 1rem;
    }

    .shared-cart-intro__copy h2 {
        font-size: 1.15rem;
    }

    .shared-cart-intro__copy p {
        font-size: clamp(1.25rem, 6vw, 1.7rem);
    }

    .shared-cart-intro__copy .button {
        width: 100%;
    }

    .shared-cart-intro__qr {
        width: 128px;
        border-width: 6px;
        border-radius: 12px;
    }
}

@media (max-width: 420px) {
    .shared-cart-intro {
        grid-template-columns: 1fr;
    }

    .shared-cart-intro__qr {
        grid-row: 1;
        justify-self: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .shared-cart-intro,
    .shared-cart-intro__qr {
        animation: none !important;
        transition: none !important;
    }

    .shared-cart-intro.is-closing {
        opacity: 0;
    }
}