/* Shared card sequence: name, options, price, then one centered action row. */
body .products-grid .product-item-details {
    align-items: stretch;
    display: flex;
    flex-direction: column;
}

body .products-grid .product-item-details > .product-item-name { order: 0; }
body .products-grid .product-item-details > .xbau-card-variants { order: 1; }
body .products-grid .product-item-details > .price-box {
    align-self: stretch;
    order: 2;
    width: 100%;
}
body .products-grid .product-item-details > .product-item-inner {
    align-self: stretch;
    order: 3;
    width: 100%;
}

body .sdwidget-product-carousel .item-price-actions-wrapper {
    align-items: stretch;
    display: flex;
    flex-direction: column;
}
body .sdwidget-product-carousel .item-price-actions-wrapper > .price-box,
body .sdwidget-product-carousel .item-price-actions-wrapper > .product-item-inner {
    width: 100%;
}
/* Equal side tracks keep quantity at the actual card center regardless of
   the wishlist/cart icon widths. The Magento form remains the submit owner. */
body :is(.products-grid,.sdwidget-product-carousel) .product-item-actions:has(.xbau-card-qty) {
    align-items: center;
    column-gap: 6px;
    display: grid;
    grid-template-columns: minmax(30px,1fr) 112px minmax(30px,1fr);
    margin: 0;
    position: relative;
    width: 100%;
}
body :is(.products-grid,.sdwidget-product-carousel) .product-item-actions:has(.xbau-card-qty) .actions-primary,
body :is(.products-grid,.sdwidget-product-carousel) .product-item-actions:has(.xbau-card-qty) .actions-primary form[data-role="tocart-form"] {
    /* A late inline storefront rule restores flex on these wrappers. */
    display: contents !important;
}
body :is(.products-grid,.sdwidget-product-carousel) .product-item-actions:has(.xbau-card-qty) .actions-secondary {
    align-self: center;
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    position: static;
}
body :is(.products-grid,.sdwidget-product-carousel) .product-item-actions:has(.xbau-card-qty) .xbau-card-qty {
    align-self: center;
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    margin: 0;
    width: 112px;
}
body :is(.products-grid,.sdwidget-product-carousel) .product-item-actions:has(.xbau-card-qty) .action.tocart {
    align-self: center;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin: 0;
}
