/* Shared item_data markup works with both React blocks and the interactive mini-cart. */
.wc-block-components-product-details > :has(.tci-line-item-pricing) {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 1em;
    width: 100%;
    max-width: 22rem;
    margin: .25em 0;
    font-size: .875rem;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

.wc-block-components-product-details > :has(.tci-line-item-pricing) > [aria-hidden="true"] {
    display: none !important;
}

.tci-line-item-pricing {
    white-space: nowrap;
}

.wc-block-components-product-details > :has(.tci-line-item-pricing--total) {
    font-weight: 700;
}

.wc-block-components-product-details > :has(.tci-line-item-pricing--discount) {
    font-size: .8125rem;
}

/* The quantity input already communicates quantity in cart and mini-cart rows.
 * Keep the labeled value for checkout and rows without a quantity input. */
.wc-block-cart-items__row:has(.wc-block-components-quantity-selector:not([hidden]) .wc-block-components-quantity-selector__input) .wc-block-components-product-details > :has(.tci-line-item-pricing--quantity) {
    display: none !important;
}

/* Replace the unlabeled native amounts only when our complete breakdown is present. */
.wc-block-cart-items__row:has(.tci-line-item-pricing) .wc-block-cart-item__prices,
.wc-block-cart-items__row:has(.tci-line-item-pricing) .wc-block-cart-item__total,
.wc-block-cart-items:has(.tci-line-item-pricing) .wc-block-cart-items__header-total,
.wc-block-components-order-summary-item:has(.tci-line-item-pricing) .wc-block-cart-item__prices,
.wc-block-components-order-summary-item:has(.tci-line-item-pricing) > .screen-reader-text,
.wc-block-components-order-summary-item:has(.tci-line-item-pricing) .wc-block-components-order-summary-item__total-price {
    display: none !important;
}

.wc-block-cart-items__row:has(.tci-line-item-pricing) .wc-block-cart-item__product {
    width: auto;
    padding-right: 0;
}

/* Defense in depth during account/price-state transitions. */
.tci-cart-block-prices-hidden .wc-block-components-product-details > :has(.tci-line-item-pricing),
.tci-cart-item--price-hidden .wc-block-components-product-details > :has(.tci-line-item-pricing) {
    display: none !important;
}
