/* Existing first/hover markup and captions stay intact. Reorder only mobile
   catalogue sale wrappers; single products and home carousels are unchanged. */
@media (max-width: 767px) {
    .zk-cat-pro-lists-wraper .zk-product-image:has(.zk-first-img-wrap > .onsale) {
        /* Reserve only the measured stock text plus its bottom inset and a
           small gap. 52px preserves the old safe reserve without JavaScript. */
        padding-bottom: calc(var(--zk-mobile-catalog-stock-height, 52px) + 16px) !important;
    }
    .zk-cat-pro-lists-wraper .zk-product-image :is(.zk-first-img-wrap, .zk-second-img-wrap):has(> .onsale) {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        align-content: flex-start;
        gap: 4px;
        height: auto !important;
    }
    .zk-cat-pro-lists-wraper .zk-product-image :is(.zk-first-img-wrap, .zk-second-img-wrap):has(> .onsale) > img {
        order: -1;
        flex: 0 0 auto;
        width: 100%;
        height: auto !important;
        max-width: 100% !important;
        margin-bottom: 2px;
    }
    .zk-cat-pro-lists-wraper .zk-product-image :is(.zk-first-img-wrap, .zk-second-img-wrap) > .onsale {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        translate: none !important;
        flex: 0 1 auto;
        min-width: 0 !important;
        max-width: 100%;
        height: auto !important;
        margin: 0 !important;
        padding: 4px 6px !important;
        font-size: 9px !important;
        line-height: 1.25 !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
        text-align: left;
    }
}
