/* Marketplace TEST: compact catalogue actions and slightly higher metadata.
 * Widgets2 / Plugins4 only; product prices, card dimensions and events unchanged. */

/* Widgets: Learn more and cart buttons about 20% smaller than 140x40. */
body.ke-themed.page-store .store--storemain.store--widgets2
.store-collection--widgets2 .ke-w2 .ke-w2__learn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: min(112px,100%);
    min-width: 0;
    max-width: 100%;
    height: 32px;
    min-height: 32px;
    padding: 5px 6px;
    font-size: 12px;
    line-height: 1.2;
    box-sizing: border-box;
}
body.ke-themed.page-store .store--storemain.store--widgets2
.store-collection--widgets2 .ke-w2 .ke-w2__cart {
    width: 112px;
    min-width: min(112px,100%);
    max-width: 100%;
    height: 32px;
    min-height: 32px;
    align-self: center;
    padding: 5px 6px;
    font-size: 12px;
    line-height: 1.2;
    box-sizing: border-box;
}
/* Portrait widget cards: align Learn more with the cart/Included button
 * by their RIGHT edge, preserving the existing two-row layout. */
body.ke-themed.page-store .store--storemain.store--widgets2
.store-collection--widgets2 .ke-w2--portrait .ke-w2__learn {
    align-self: flex-end;
    margin-left: auto;
    margin-right: 18px;
}
@media (max-width: 767px) {
    body.ke-themed.page-store .store--storemain.store--widgets2
    .store-collection--widgets2 .ke-w2--portrait .ke-w2__learn {
        margin-right: -6px;
    }
}

/* One text line up, while leaving the Learn more action in its normal position.
 * The landscape layout already places metadata separately; keep it unchanged. */
body.ke-themed.page-store .store--storemain.store--widgets2
.store-collection--widgets2 .ke-w2--portrait .ke-w2__meta {
    transform: translateY(-24px);
}

/* Plugins: Learn more 126x36 -> 101x29. The metadata stays at its
 * original baseline: long plugin descriptions have little clearance.
 * Keep the A/B product rows unchanged. */
body.ke-themed.page-store .store--storemain.store--plugins4
.store-collection--plugins4 .ke-p4 .ke-w2__meta-actions {
    grid-template-columns: minmax(0,1fr) 101px;
    column-gap: 10px;
    min-height: 36px;
}
body.ke-themed.page-store .store--storemain.store--plugins4
.store-collection--plugins4 .ke-p4 .ke-w2__learn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 101px;
    min-width: 0;
    max-width: 100%;
    height: 29px;
    min-height: 29px;
    padding: 4px 5px;
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    box-sizing: border-box;
}

/* Plugin Add to Cart / Included: 80% of original full width; 38 -> 30px high. */
body.ke-themed.page-store .store--storemain.store--plugins4
.store-collection--plugins4 .ke-p4 .ke-p4__checkout {
    flex: 0 1 80%;
    width: 80%;
    max-width: 80%;
    min-width: 0;
    height: 30px;
    min-height: 30px;
    padding: 4px 8px;
    margin-inline: auto;
    font-size: 12px;
    line-height: 1.2;
    box-sizing: border-box;
}
/* Mobile layout: the legacy 50% offset + translateX(-50%) was applied
 * on top of the already centered .container and shifted the whole Marketplace
 * by 12px. Reset that positioning for both Widgets and Plugins. */
@media (max-width:767px) {
    body.ke-themed.page-store .store--storemain {
        left: auto;
        transform: none;
        margin-left: auto;
        margin-right: auto;
    }
    body.ke-themed.page-store .store--storemain
    .store-collection--widgets2 .store-collection__rail {
        justify-content: center;
    }
    body.ke-themed.page-store .store--storemain.store--plugins4
    .store-collection--plugins4 .ke-p4__footer {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    body.ke-themed.page-store .store--storemain.store--plugins4
    .store-collection--plugins4 .ke-p4__checkout {
        align-self: center;
        margin-left: auto;
        margin-right: auto;
    }
}
@media (max-width:350px) {
    body.ke-themed.page-store .store--storemain.store--plugins4
    .store-collection--plugins4 .ke-p4 .ke-w2__meta-actions {
        grid-template-columns: minmax(0,1fr) 88px;
        column-gap: 6px;
    }
    body.ke-themed.page-store .store--storemain.store--plugins4
    .store-collection--plugins4 .ke-p4 .ke-w2__learn {
        width: 88px;
    }
}
