.features-page .row:has(> .feature-card > .feature-preview-media),
.row.home-feature-previews {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.features-page .feature-card,
.home-feature-previews > .feature-card {
    border-radius: 14px;
}

.home-feature-previews {
    gap: 24px;
}

.home-feature-previews h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.feature-card:has(> .feature-preview-media) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    padding: 0;
    text-align: left;
}

.feature-card:has(> .feature-preview-media)::before {
    content: none;
}

.feature-preview-copy {
    align-content: center;
    padding: clamp(20px, 3vw, 44px);
    min-width: 0;
}

.feature-preview-copy h3.big-text {
    margin: 0 0 12px;
}

.feature-preview-copy p {
    margin: 0 0 12px;
}

.feature-preview-copy ul {
    margin-bottom: 0;
}

.home-overview__layout {
    display: grid;
    gap: clamp(24px, 5vw, 64px);
    align-items: start;
}

.home-overview__shots {
    position: relative;
    display: grid;
    width: 100%;
    max-width: 560px;
    margin-inline: auto;
}

.home-overview__shots img {
    display: block;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgb(32 46 65 / 18%);
}

.home-overview__main {
    grid-area: 1 / 1;
    align-self: start;
    width: 92%;
    outline: 1px solid rgb(32 46 65 / 24%);
}

.home-overview__cart-cover {
    display: none;
    position: absolute;
    inset: 0 8% 0 0;
    pointer-events: none;
}

.home-overview__shots:is([data-cart-fill="waiting"], [data-cart-fill="running"]) .home-overview__cart-cover {
    display: block;
}

.home-overview__cart-cover::before,
.home-overview__cart-cover::after,
.home-overview__cart-cover span {
    position: absolute;
    content: '';
}

/* Границы строк и итогов на снимке главного окна (1080 × 710). */
.home-overview__cart-cover::before {
    inset: 27.18% calc(6.76% - 0.5px) 49.30% calc(1.39% - 0.5px);
    background: #fcfcfc;
}

.home-overview__cart-cover::after {
    inset: 79.3% 65.7% 16.3% 25.9%;
    background: #eee;
}

.home-overview__cart-cover span {
    inset: 59.1% 65% 38.2% 1.35%;
    background: #eee;
}

.home-overview__shots[data-cart-fill="running"] .home-overview__cart-cover::before {
    animation: overview-cart-rows 1.65s steps(1, end) both;
}

@keyframes overview-cart-rows {
    0% { clip-path: inset(0); }
    20% { clip-path: inset(19.3% 0 0); }
    40% { clip-path: inset(39.2% 0 0); }
    60% { clip-path: inset(58.9% 0 0); }
    80% { clip-path: inset(78.9% 0 0); }
    100% { clip-path: inset(100% 0 0); }
}

.home-overview__payment {
    position: absolute;
    inset-block-start: 27%;
    inset-inline-end: 0;
    width: 32%;
}

.home-overview__payment img {
    width: 100%;
    box-shadow: 0 12px 26px rgb(32 46 65 / 30%);
}

.home-overview__pay-button,
.home-overview__cancel-button {
    position: absolute;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
}

.home-overview__pay-button {
    inset: 85.5% 46% 3.5% 4%;
    box-shadow: 0 0 0 1px rgb(33 133 56 / 35%);
}

.home-overview__cancel-button {
    inset: 87.8% 3.9% 3.4% 66.1%;
}

@media (prefers-reduced-motion: no-preference) {
    .home-overview__pay-button.is-highlighted {
        animation: overview-pay-pulse 2.2s ease-in-out 2;
    }
}

@keyframes overview-pay-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgb(33 133 56 / 35%); }
    50% { box-shadow: 0 0 0 4px rgb(33 133 56 / 24%), 0 0 10px rgb(33 133 56 / 32%); }
}

:is(.home-overview__pay-button, .home-overview__cancel-button):hover {
    background: rgb(255 255 255 / 14%);
}

:is(.home-overview__pay-button, .home-overview__cancel-button):focus-visible {
    outline: 2px solid #fff;
    outline-offset: -3px;
}

.home-overview__receipt-feed:not([hidden]) {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.home-overview__cancel-scene:not([hidden]) {
    position: absolute;
    inset: auto auto -8px -12px;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    max-width: 64%;
    clip-path: inset(-24px -24px 0 0);
    pointer-events: none;
}

.home-overview__cashier {
    flex: 0 0 auto;
    width: clamp(96px, 11vw, 152px);
    margin-inline-start: -22px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    transform-origin: bottom left;
    transform: rotate(9deg);
}

.home-overview__cashier img {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 4px 8px rgb(32 46 65 / 20%));
}

.home-overview__cancel-scene p {
    position: relative;
    box-sizing: border-box;
    min-height: 4em;
    width: 12em;
    margin: clamp(20px, 2.4vw, 34px) 0 0 -24px;
    padding: 0.65em 0.8em;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #202124;
    font-size: clamp(0.8rem, 1.1vw, 0.95rem);
    font-weight: 600;
    line-height: 1.35;
    white-space: pre-line;
    box-shadow: 0 4px 14px rgb(32 46 65 / 18%);
}

.home-overview__cancel-scene p::before {
    position: absolute;
    top: 50%;
    left: -5px;
    width: 8px;
    height: 8px;
    border-left: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    background: inherit;
    transform: translateY(-50%) rotate(45deg);
    content: '';
}

@media (prefers-reduced-motion: no-preference) {
    .home-overview__cancel-scene:not([hidden]) .home-overview__cashier {
        animation: overview-cashier-peek 720ms cubic-bezier(0.2, 0.75, 0.35, 1) both;
    }

    .home-overview__cancel-scene.is-leaving .home-overview__cashier {
        animation: overview-cashier-retreat 260ms ease-in both;
    }

    .home-overview__cancel-scene p:not([hidden]) {
        animation: overview-bubble-appear 240ms ease-out both;
    }
}

@keyframes overview-cashier-peek {
    0% { transform: translateX(-115%) rotate(-24deg); }
    75% { transform: rotate(13deg); }
    100% { transform: rotate(9deg); }
}

@keyframes overview-cashier-retreat {
    from { transform: rotate(9deg); }
    to { transform: translateX(-115%) rotate(-24deg); }
}

@keyframes overview-bubble-appear {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.home-overview__receipt-track {
    display: flex;
    align-items: flex-end;
    min-height: 100%;
    clip-path: inset(-24px -24px 0);
}

.home-overview__receipt {
    position: relative;
    box-sizing: border-box;
    width: min(84%, 264px);
    margin: 0 auto;
    pointer-events: auto;
    cursor: pointer;
    padding: 8px 12px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: #fff;
    color: #202124;
    font: 0.75rem/1.4 ui-monospace, Consolas, monospace;
    box-shadow: 0 8px 22px rgb(32 46 65 / 24%);
}

.home-overview__receipt-close {
    position: absolute;
    inset: 2px 2px auto auto;
    min-width: 28px;
    min-height: 28px;
    border: 0;
    border-radius: 3px;
    background: #fff;
    color: #55585d;
    font: inherit;
    font-size: 1.125rem;
    cursor: pointer;
}

.home-overview__receipt figcaption {
    padding-bottom: 5px;
    border-bottom: 1px dashed #a0a4aa;
    font-weight: 700;
    text-align: center;
}

.home-overview__receipt small {
    display: block;
    color: #55585d;
    font-weight: 400;
}

.home-overview__receipt dl {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 8px;
    margin: 5px 0 0;
}

.home-overview__receipt dt {
    overflow-wrap: anywhere;
}

.home-overview__receipt dd {
    margin: 0;
    text-align: right;
    white-space: nowrap;
}

.home-overview__receipt-total {
    padding-block: 4px;
    border-block: 1px dashed #a0a4aa;
    font-weight: 700;
}

.home-overview__receipt-meta {
    margin: 6px 0 2px;
    text-align: center;
    font-size: 0.6875rem;
}

.home-overview__receipt .home-overview__receipt-qr {
    width: 66px;
    margin-inline: auto;
    border-radius: 0;
    box-shadow: none;
}

.home-overview__status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

@media (prefers-reduced-motion: no-preference) {
    .home-overview__receipt-feed:not([hidden]) .home-overview__receipt {
        animation: overview-print-receipt 1.8s linear both;
    }
}

@keyframes overview-print-receipt {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.home-overview__copy p:first-child {
    margin-top: 0;
}

@media (min-width: 960px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .home-overview__payment {
        transform: translate(var(--payment-x, 0px), var(--payment-y, 0px));
        transition: transform 180ms ease-out;
    }
}

.home-feature-previews :is(.feature-card, .feature-preview-copy) > :is(h3, p) {
    margin-block: 0 12px;
    text-align: center;
}

.feature-preview-media {
    display: grid;
    place-items: center;
    align-content: center;
    padding: clamp(14px, 2.8vw, 32px);
    min-width: 0;
}

.feature-card img.feature-preview-shot:not(.feature-card__bg) {
    box-sizing: border-box;
    display: block;
    width: min(100%, var(--feature-preview-width));
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    height: auto;
    margin: 0;
    object-fit: contain;
    box-shadow: 0 8px 20px rgb(32 46 65 / 16%);
}

@media (min-width: 760px) {
    .home-overview__layout {
        grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    }

    .home-overview__shots {
        max-width: 672px;
    }

    .features-page .row:has(> .feature-card > .feature-preview-media) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-card:has(> .feature-preview-media) {
        container-type: inline-size;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "copy media";
    }

    .feature-preview-copy {
        grid-area: copy;
    }

    .feature-preview-copy > :is(h3.big-text, p, ul) {
        max-width: 28rem;
        margin-inline: auto;
    }

    .feature-preview-media {
        grid-area: media;
        justify-items: end;
        width: min(60cqw, var(--feature-preview-width));
        padding-inline: 0;
    }

    .feature-card img.feature-preview-shot:not(.feature-card__bg) {
        translate: calc(clamp(14px, 2vw, 24px) * var(--preview-shot-direction, 1));
    }

    :where(.features-page section:nth-child(even of section:has(.feature-preview-shot))) .feature-card:has(> .feature-preview-media),
    .feature-preview-reversed:has(> .feature-preview-media) {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "media copy";
    }

    :where(.features-page section:nth-child(even of section:has(.feature-preview-shot))) .feature-preview-media,
    .feature-preview-reversed > .feature-preview-media {
        --preview-shot-direction: -1;
        justify-items: start;
    }
}

@media (min-width: 960px) {
    .row.home-feature-previews {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .home-feature-previews > .feature-card {
        grid-column: span 2;
    }

    .home-feature-previews > .feature-card:has(> .feature-preview-media) {
        grid-column: span 4;
    }

    .home-feature-previews .feature-preview-media {
        width: min(46cqw, var(--feature-preview-width));
    }

    .home-feature-previews :is(.feature-preview-copy, .feature-preview-media),
    .home-feature-previews > .feature-card:not(:has(> .feature-preview-media)) {
        padding-block: clamp(20px, 2vw, 28px);
    }

    .home-feature-previews .feature-preview-copy {
        align-content: start;
    }
}

@media (min-width: 760px) and (hover: hover) {
    .feature-card:hover img.feature-preview-shot:not(.feature-card__bg) {
        translate: calc(-8px * var(--preview-shot-direction, 1));
    }

    @media (prefers-reduced-motion: no-preference) {
        .feature-card img.feature-preview-shot:not(.feature-card__bg) {
            transition: translate 320ms ease-out;
        }
    }
}
