.kupetz-weight-product {
    box-sizing: border-box;
    margin: .85rem 0 .65rem;
    max-width: 360px;
}

.kupetz-weight-product__label,
.kupetz-weight-product__quantity-label {
    display: block;
    font-weight: 600;
    margin: 0 0 .35rem;
}

.kupetz-weight-product__input-row {
    align-items: center;
    display: flex;
    gap: .5rem;
    width: max-content;
}

/* Use WooCommerce's own quantity-input structure so weight and quantity look
 * like one family of controls. The weight field is deliberately wider because
 * it commonly contains three decimal places. */
.kupetz-weight-product__weight-quantity,
.kupetz-weight-product__quantity .quantity {
    display: inline-block;
    margin: 0;
}

.kupetz-product-detail .cart .kupetz-weight-product__input,
.single-product form.cart .kupetz-weight-product__input {
    box-sizing: border-box;
    font: inherit;
    height: 34px;
    line-height: 1.2;
    max-width: none;
    padding: .35rem .5rem;
    width: 118px;
}

/* Keep the normal Woo quantity control visually aligned with the new weight
 * field without forcing it to be unnecessarily wide. */
.kupetz-product-detail .cart .kupetz-weight-product__quantity input.qty,
.single-product form.cart .kupetz-weight-product__quantity input.qty {
    box-sizing: border-box;
    font: inherit;
    height: 34px;
    line-height: 1.2;
    padding-bottom: .35rem;
    padding-top: .35rem;
}

.kupetz-weight-product__unit {
    font-weight: 600;
    white-space: nowrap;
}

.kupetz-weight-product__hint {
    font-size: .82em;
    line-height: 1.35;
    margin-top: .35rem;
    opacity: .68;
}

.kupetz-weight-product__total {
    border-left: 3px solid var(--kupetz-color-gold, #b8892f);
    display: grid;
    gap: .15rem;
    margin-top: .8rem;
    padding: .55rem .7rem;
}

.kupetz-weight-product__total[hidden] {
    display: none;
}

.kupetz-weight-product__total > span {
    font-size: .88em;
}

.kupetz-weight-product__total > strong {
    font-size: 1.16em;
    line-height: 1.25;
}

.kupetz-weight-product__formula {
    font-size: .78em;
    line-height: 1.35;
    opacity: .7;
}

.kupetz-weight-product__quantity {
    display: inline-flex;
    flex-direction: column;
    margin: .15rem .7rem .65rem 0;
    vertical-align: bottom;
}

.kupetz-weight-product__quantity .quantity {
    margin: 0;
}

.kupetz-price-label {
    font-size: .78em;
    font-weight: 400;
    white-space: nowrap;
}

.kupetz-price-unit,
.kupetz-cart-price-unit {
    font-size: .75em;
    font-weight: 400;
    white-space: nowrap;
}

@media (max-width: 575px) {
    .kupetz-weight-product {
        max-width: 100%;
    }

    .kupetz-product-detail .cart .kupetz-weight-product__input,
    .single-product form.cart .kupetz-weight-product__input {
        width: 112px;
    }
}

/* Cart/checkout selected-weight summary. Keep all weight information in one
 * explicit formula rather than WooCommerce's generic variation <dl>, which is
 * too cramped in the site's narrow checkout table. */
.kupetz-weight-summary {
    align-items: baseline;
    border-left: 2px solid var(--kupetz-color-gold, #b8892f);
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    font-size: .82em;
    font-weight: 400;
    gap: .08rem .32rem;
    line-height: 1.35;
    margin-top: .3rem;
    max-width: 100%;
    padding: .18rem 0 .18rem .45rem;
    width: fit-content;
}

.kupetz-weight-summary__label {
    opacity: .75;
}

.kupetz-weight-summary__single,
.kupetz-weight-summary__calculation strong {
    font-weight: 600;
}

.kupetz-weight-summary__calculation {
    white-space: normal;
}

.woocommerce-checkout-review-order-table .kupetz-weight-summary {
    margin-top: .22rem;
}

@media (max-width: 575px) {
    .kupetz-weight-summary {
        font-size: .78em;
        gap: .05rem .25rem;
        line-height: 1.3;
        padding-left: .38rem;
    }
}

