/**
 * Limebug Commerce UI foundation hardening layer.
 * Scope: Cart + Checkout only.
 * Purpose: enforce one restrained type system and shared visual rhythm without
 * changing WooCommerce/Rey commerce behaviour or moving functional DOM.
 */
body.lbcui-cart-active,
body.lbcui-checkout-active {
    --lbcui-type-sm: 12px;
    --lbcui-type-md: 14px;
    --lbcui-type-lg: 18px;
    --lbcui-type-weight: 400;
    --lbcui-line-tight: 1.25;
    --lbcui-line-normal: 1.4;
}

/* One weight only. Hierarchy comes from size, spacing, case and contrast. */
body.lbcui-cart-active .rey-cartPage :where(
    h1,h2,h3,h4,h5,h6,p,span,a,label,small,strong,b,em,i,
    th,td,button,input,select,textarea,.button
),
body.lbcui-checkout-active :where(
    h1,h2,h3,h4,h5,h6,p,span,a,label,small,strong,b,em,i,
    th,td,button,input,select,textarea,.button
) {
    font-weight: var(--lbcui-type-weight) !important;
}

/* Small / metadata tier. */
body.lbcui-cart-active :where(
    thead th,
    .product-sku,
    .sku,
    .woocommerce-cart-form__cart-item-sku,
    .woocommerce-cart-form__cart-sku,
    .woocommerce-notices-wrapper,
    .woocommerce-message,
    .woocommerce-info,
    .woocommerce-error,
    .cart_totals small,
    .cart_totals .includes_tax
),
body.lbcui-checkout-active :where(
    label,
    .woocommerce-form__label,
    .woocommerce-checkout-review-order small,
    .includes_tax,
    .product-sku,
    .sku,
    .lbcui-payment-marks,
    .lbcui-checkout-header__status,
    .lbcui-mobile-header-stable__status
) {
    font-size: var(--lbcui-type-sm) !important;
    line-height: var(--lbcui-line-normal) !important;
}

/* Main UI tier. */
body.lbcui-cart-active :where(
    .woocommerce-cart-form,
    .woocommerce-cart-form a,
    .woocommerce-cart-form input,
    .woocommerce-cart-form button,
    .cart_totals,
    .cart_totals input,
    .cart_totals button,
    .woocommerce-cart-form__cart-item .product-name,
    .woocommerce-cart-form__cart-item .product-price,
    .woocommerce-cart-form__cart-item .product-quantity,
    .woocommerce-cart-form__cart-item .product-subtotal
),
body.lbcui-checkout-active :where(
    .woocommerce-checkout,
    .woocommerce-checkout input,
    .woocommerce-checkout select,
    .woocommerce-checkout textarea,
    .woocommerce-checkout button,
    .woocommerce-checkout .button,
    .woocommerce-checkout-review-order,
    .woocommerce-checkout-review-order-table,
    .lbcui-checkout-header,
    .lbcui-mobile-header-stable
) {
    font-size: var(--lbcui-type-md) !important;
    line-height: var(--lbcui-line-normal) !important;
}

/* Major hierarchy tier. Keep intentionally rare. */
body.lbcui-cart-active :where(
    .cart_totals .order-total,
    .cart_totals .order-total th,
    .cart_totals .order-total td,
    .lbcui-cart-heading
),
body.lbcui-checkout-active :where(
    .lbcui-page-title,
    .woocommerce-checkout h2,
    .woocommerce-checkout h3,
    .woocommerce-checkout-review-order .order-total,
    .woocommerce-checkout-review-order .order-total th,
    .woocommerce-checkout-review-order .order-total td
) {
    font-size: var(--lbcui-type-lg) !important;
    line-height: var(--lbcui-line-tight) !important;
}

/* Native product titles must wrap as one title, never paragraph-like blocks. */
body.lbcui-cart-active .woocommerce-cart-form__cart-item .product-name :where(a,p,span,strong,b),
body.lbcui-cart-active .woocommerce-cart-form__cart-name :where(a,p,span,strong,b),
body.lbcui-checkout-active .woocommerce-checkout-review-order .product-name :where(a,p,span,strong,b) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: var(--lbcui-line-tight) !important;
}


/* v0.8.1 strict typography lock: exactly three sizes and one weight. */
body.lbcui-cart-active .rey-cartPage *,
body.lbcui-checkout-active .rey-checkoutPage * {
    font-weight: 400 !important;
}
body.lbcui-cart-active .rey-cartPage :is(p,span,a,label,th,td,button,input,select,textarea,div),
body.lbcui-checkout-active .rey-checkoutPage :is(p,span,a,label,th,td,button,input,select,textarea,div) {
    font-size: 14px !important;
}
body.lbcui-cart-active .rey-cartPage :is(.product-sku,.sku,thead th,small,.includes_tax,.woocommerce-notices-wrapper,.woocommerce-message,.woocommerce-info,.woocommerce-error),
body.lbcui-checkout-active .rey-checkoutPage :is(label,small,.includes_tax,.product-sku,.sku,.rey-checkoutBar li,.lbcui-payment-marks,.lbcui-checkout-header__status,.lbcui-mobile-header-stable__status) {
    font-size: 12px !important;
}
body.lbcui-cart-active .rey-cartPage :is(.order-total,.order-total th,.order-total td,.cart_totals h2),
body.lbcui-checkout-active .rey-checkoutPage :is(h2,h3,.order-total,.order-total th,.order-total td,.lbcui-order-brand__title strong) {
    font-size: 18px !important;
}
