.p2p-hero__account-inner {
    .p2p-hero__recent-purchases-list {
        display: flex;
        flex-direction: column;
        gap: 0.625rem;
    }

    .p2p-hero__recent-purchase {
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr) auto;
        align-items: stretch;
        gap: 1rem;

        background-color: #fff;
        color: #111;
        border: 1px solid #000000;
        border-radius: 12px;
        overflow: hidden;

        transition:
            border-color 0.2s ease,
            box-shadow 0.2s ease;

        &:hover {
            border-color: #202020;
            box-shadow: 0 4px 14px rgba(109, 109, 109, 0.253);
        }
    }

    .p2p-hero__recent-purchase-image-link {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 72px;
        min-height: 72px;
        padding: 0.375rem;

        background-color: #fff;
        text-decoration: none;
    }

    .p2p-hero__recent-purchase-image {
        display: block;
        width: 100%;
        height: 100%;
        max-height: 64px;
        object-fit: contain;

        transition: transform 0.2s ease;
    }

    .p2p-hero__recent-purchase-image-link:hover
    .p2p-hero__recent-purchase-image {
        transform: scale(1.04);
    }

    .p2p-hero__recent-purchase-content {
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.75rem 0;
    }

    .p2p-hero__recent-purchase-title {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        color: #111;
        font-size: 0.925rem;
        font-weight: 600;
        line-height: 1.4;
        text-decoration: none;

        transition: color 0.2s ease;

        &:hover {
            color: #444;
        }

        &:focus-visible {
            outline: 2px solid #555;
            outline-offset: 3px;
            border-radius: 2px;
        }
    }

    .p2p-hero__recent-purchase-price {
        display: block;
        color: #444;
        font-size: 0.875rem;
        font-weight: 500;
        line-height: 1.4;
    }

    .p2p-hero__recent-purchase-action {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        min-width: 44px;
        align-self: stretch;

        /*
         * The add-to-cart control itself is styled in
         * template-tags/product-qty-selector.css; here it only gets a
         * separator from the product details.
         */
        .product-cart-qty-selector {
            height: 100%;
            padding: 0 0.625rem;
            border-left: 1px solid rgba(0, 0, 0, 0.15);
        }
    }

    .p2p-hero__recent-purchase-empty {
        margin: 0;
        padding: 1.25rem;

        border: 1px dashed #d0d0d0;
        border-radius: 12px;

        color: #444;
        text-align: center;
        font-size: 0.925rem;
        line-height: 1.6;
    }

    .p2p-hero__checkout-button {
        display: flex;
        align-items: center;
        justify-content: space-around;
        align-self: end;
        
            padding: 10px 20px;
            margin-top: 1rem;

            width: 50%;
            max-width: 300px;
            border: 2px solid #fff;
            border-radius: 10px;
            background: rgba(0, 0, 0, 0.4);
            color: #fff;
        
            font-size: 1rem;
            line-height: 1;
            text-decoration: none;
        
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
            cursor: pointer;
        
            transition:
                transform 0.2s ease,
                background-color 0.2s ease;
        
            &:hover {
                background-color: rgba(0, 0, 0, 0.7);
                color: #fff;
            }
        
            &:focus-visible {
                outline: 2px solid #555;
                outline-offset: 3px;
            }
        }
        
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
    .p2p-hero__account-inner {
        .p2p-hero__recent-purchase,
        .p2p-hero__recent-purchase-image,
        .p2p-hero__recent-purchase-title,
        .p2p-hero__recent-purchase-action .product-cart__button,
        .p2p-hero__checkout-button {
            transition: none;
        }
    }
}

/* Compact layouts. */
@media (max-width: 575.98px) {
    .p2p-hero__account-inner {
        .p2p-hero__recent-purchases-list {
            gap: 0.5rem;
        }

        .p2p-hero__recent-purchase {
            grid-template-columns: 60px minmax(0, 1fr) auto;
            gap: 0.75rem;
            border-radius: 10px;
        }

        .p2p-hero__recent-purchase-image-link {
            width: 60px;
            min-height: 60px;
            padding: 0.25rem;
        }

        .p2p-hero__recent-purchase-image {
            max-height: 54px;
        }

        .p2p-hero__recent-purchase-content {
            padding: 0.5rem 0;
        }

        .p2p-hero__recent-purchase-title {
            font-size: 0.85rem;
        }

        .p2p-hero__recent-purchase-price {
            font-size: 0.8rem;
        }

        .p2p-hero__checkout-button {
            width: 100%;
        }
    }
}

/* =========================================================
   Narrow account column
   The cards respond to the width of the account box itself
   (container query), not the screen, so they fit wherever the
   hero places the box.
   ========================================================= */

.p2p-hero__account {
    container: p2p-account / inline-size;
}

@container p2p-account (max-width: 26rem) {

    section.p2p-hero .p2p-hero__account > .p2p-hero__account-inner {
        margin: 1.5rem;
    }

    .p2p-hero__account-inner {

        /* Image + full name on top, price and cart controls below. */
        .p2p-hero__recent-purchase {
            grid-template-columns: 56px minmax(0, 1fr);
            grid-template-areas:
                "image   content"
                "action  action";
            gap: 0 0.75rem;
        }

        .p2p-hero__recent-purchase-image-link {
            grid-area: image;
            width: 56px;
            min-height: 56px;
        }

        .p2p-hero__recent-purchase-content {
            grid-area: content;
            padding: 0.5rem 0.75rem 0.5rem 0;
        }

        .p2p-hero__recent-purchase-title {
            white-space: normal;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            font-size: 0.875rem;
        }

        .p2p-hero__recent-purchase-action {
            grid-area: action;
            justify-content: flex-end;
            border-top: 1px solid rgba(0, 0, 0, 0.15);

            .product-cart-qty-selector {
                height: auto;
                padding: 0.375rem 0.625rem;
                border-left: 0;
            }
        }

        .p2p-hero__checkout-button {
            width: 100%;
            max-width: none;
        }
    }
}
