/* ============================================================
 *  Janiyar Segal — RTL Overrides
 *  فقط استایل‌هایی که با logical properties نمی‌شدند
 * ============================================================ */

/* ---------- Direction صریح ---------- */
html[dir="rtl"] body,
body.rtl,
body.is-rtl {
    direction: rtl;
    text-align: right;
}

/* ---------- فیلدهای عددی و لاتین ---------- */
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="password"],
.js-ltr-input {
    direction: ltr;
    text-align: left;
}
input[type="tel"] {
    /* شماره موبایل ایران — اما در فرم فارسی چپ‌چین */
    unicode-bidi: isolate;
}

/* ---------- WooCommerce Specific RTL ---------- */
.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    text-align: right;
}
.woocommerce table.shop_table thead th {
    text-align: right;
}
.woocommerce .quantity .qty {
    direction: ltr;
}
.woocommerce-Price-amount,
.woocommerce-Price-amount.amount,
.woocommerce-Price-currencySymbol {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
}
.woocommerce .star-rating {
    direction: ltr;
    float: right;
}
.woocommerce .star-rating span {
    float: left;
}

/* ---------- Select2 و فیلدهای ووکامرس ---------- */
.woocommerce .select2-container .select2-selection--single .select2-selection__arrow {
    left: 8px;
    right: auto;
}
.woocommerce form .form-row-first,
.woocommerce form .form-row-last,
.woocommerce-page form .form-row-first,
.woocommerce-page form .form-row-last {
    float: right;
}
.woocommerce form .form-row-first,
.woocommerce-page form .form-row-first {
    margin-left: 4%;
    margin-right: 0;
}

/* ---------- Notice ---------- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding-right: 46px;
    padding-left: 20px;
}
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    right: 16px;
    left: auto;
}

/* ---------- Cart remove button ---------- */
.woocommerce table.cart td.product-remove a.remove {
    /* در RTL گوشه سمت چپ */
    margin: 0;
}

/* ---------- Checkout ---------- */
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review {
    /* اطمینان از راست‌چین بودن */
    direction: rtl;
}

/* ---------- Variations ---------- */
.woocommerce div.product form.cart .variations td.label,
.woocommerce div.product form.cart .variations th.label {
    text-align: right;
    padding-left: 12px;
    padding-right: 0;
}

/* ---------- SOW Override (پلاگین Steel Order Workflow) ---------- */
.sow-wrap,
.sow-card,
.sow-form,
.sow-detail-card,
.sow-stepper-wrap,
.sow-hero {
    direction: rtl;
    text-align: right;
}
.sow-detail-value--num,
.sow-hero__number,
.sow-plate-display {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: right;
}

/* ---------- SCP Override ---------- */
.scp-wrap,
.scp-sidebar,
.scp-panel,
.scp-form,
.scp-order,
.scp-ticket-item,
.scp-conv-item {
    direction: rtl;
    text-align: right;
}

/* ---------- ISRP Override ---------- */
.isrp-chart-block,
.isrp-table-container,
.isrp-card,
.isrp-modal,
.isrp-price-table,
.isrp-buy-modal-body,
.isrp-order-form {
    direction: rtl;
    text-align: right;
}
.isrp-price-table td.isrp-td-price,
.isrp-price-table td.isrp-td-buy,
.isrp-price-table td.isrp-td-chart {
    text-align: right;
}
.isrp-price-value,
.isrp-card-price,
.isrp-price-table .isrp-price-value {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: right;
    display: inline-block;
}

/* ---------- Nav Submenu در RTL ---------- */
.js-nav .sub-menu {
    right: 0;
    left: auto;
}
.js-nav .sub-menu .sub-menu {
    right: 100%;
    left: auto;
}

/* ---------- Breadcrumbs در RTL ---------- */
.js-breadcrumbs {
    direction: rtl;
}

/* ---------- Footer در RTL ---------- */
.js-footer__contact li svg {
    flex-shrink: 0;
}

/* ---------- Back to Top در RTL ---------- */
.js-back-to-top {
    /* inset-inline-end کار می‌کنه، ولی برای اطمینان: */
    right: auto;
    left: 24px;
}
@media (min-width: 900px) {
    .js-back-to-top {
        right: auto;
        left: 24px;
    }
}

/* ---------- Placeholder ---------- */
::placeholder {
    text-align: right;
    direction: rtl;
}
input[dir="ltr"]::placeholder,
.js-ltr-input::placeholder {
    text-align: left;
    direction: ltr;
}

/* ---------- Select در RTL ---------- */
select {
    /* فلش سمت چپ */
    background-position: left 12px center;
    padding-left: 36px;
    padding-right: 14px;
}

/* ---------- Number input در RTL ---------- */
input[type="number"] {
    direction: ltr;
    text-align: right;
}