/*
 * SIM2080 — global phone-number direction/typography hardening.
 * Keeps SIM numbers LTR inside RTL Persian layouts so theme updates cannot reset them.
 */
.sim2080-number-ltr,
.sim2080-number-ltr * {
    direction: ltr !important;
    unicode-bidi: isolate !important;
    display: inline-block !important;
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums !important;
    text-align: left !important;
    letter-spacing: .12px;
}

/* Classic WooCommerce */
.woocommerce-cart .product-name .sim2080-number-ltr,
.woocommerce-cart-form .product-name a,
.woocommerce-cart-form .product-name,
.woocommerce-checkout-review-order .product-name,
.woocommerce-checkout-review-order-table .product-name,
.woocommerce-mini-cart .mini_cart_item .quantity,
.woocommerce-mini-cart .mini_cart_item .product-title,
.widget_shopping_cart .mini_cart_item .product-title,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
.woocommerce ul.products li.product .product-title,
.woocommerce-page ul.products li.product .woocommerce-loop-product__title,
.woocommerce-page ul.products li.product a.woocommerce-LoopProduct-link,
.single-product .product_title,
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notices-wrapper,
.woocommerce-order-details .product-name,
.woocommerce-table--order-details .product-name,
.woocommerce .order_item .product-name {
    /* Do not change the flow direction of the whole sentence/cell. */
}

.woocommerce-cart-form .product-name a,
.woocommerce-cart .cart_item .product-name a,
.woocommerce-checkout-review-order .product-name a,
.woocommerce-order-details .product-name a,
.woocommerce-table--order-details .product-name a,
.woocommerce .mini_cart_item .product-title,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .product-title,
.single-product .product_title {
    unicode-bidi: plaintext;
}

/* WooCommerce Blocks / newer cart & product blocks */
.wc-block-cart-item__product .wc-block-components-product-name,
.wc-block-components-product-name,
.wc-block-grid__product-title,
.wc-block-components-order-summary-item__description,
.wc-block-components-order-summary-item__quantity {
    unicode-bidi: plaintext;
}

/* WordPress / WooCommerce product list in wp-admin */
body.post-type-product .wp-list-table .row-title,
body.edit-php.post-type-product .wp-list-table .row-title,
body.post-type-product .wp-list-table td.column-name,
body.post-type-product .wp-list-table td.column-title,
body.post-type-product #title {
    font-variant-numeric: tabular-nums;
}

body.post-type-product .wp-list-table .row-title {
    unicode-bidi: plaintext;
}

body.post-type-product #title {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}

/* The admin-bar and our own management table are safe to isolate by wrapper. */
#wpadminbar .sim2080-number-ltr,
.sim2080-manage-wrap .sim2080-number-ltr,
.sim2080-manage-table .sim2080-number-ltr {
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

/* Common title/name anchors where the JS wrapper may not be needed. */
.woocommerce-cart .product-name a,
.woocommerce-checkout .product-name a,
.woocommerce-order-details .product-name a,
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce-page ul.products li.product .woocommerce-loop-product__link,
.woocommerce-page ul.products li.product .woocommerce-loop-product__title {
    text-rendering: optimizeLegibility;
}

@media (max-width: 767px) {
    .woocommerce ul.products li.product .woocommerce-loop-product__title,
    .woocommerce-page ul.products li.product .woocommerce-loop-product__title {
        line-height: 1.65;
    }
}
