/* =========================================================
   Right-to-left overrides (Persian, Arabic, Hebrew).
   Loaded only when WordPress's site language is a right-to-left language.
   Flex and grid layouts flip by themselves; this file fixes the rest:
   left/right positions, slide-in drawers, padding, margins and text alignment.
   ========================================================= */

.skip-link:focus { left: auto; right: .5rem; }

/* Email, phone and web addresses are typed left to right, but sit on the right edge */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="url"] { direction: ltr; text-align: right; }

/* Notices: accent bar on the right */
body .woocommerce-message,
body .woocommerce-info,
body .woocommerce-error { border-left: 0; border-right: 3px solid var(--c-accent); }
body .woocommerce-error { border-right-color: #b3261e; }

/* Header */
.cart-count { right: auto; left: 0; }
.primary-nav .sub-menu { left: auto; right: -1rem; }

/* Shop */
.site-main .shop-toolbar .woocommerce-ordering { margin: 0 auto 0 0; }
.woocommerce-ordering select { padding: .6em .8em .6em 2em; }
.shop-filters { padding-right: 0; padding-left: .25rem; }
.filter-list--sub { padding-left: 0; padding-right: 1rem; }

/* Sale badges sit in the top-right corner of the image */
.site-main .wrap ul.products li.product .onsale,
.single-product .site-main div.product span.onsale { left: auto; right: .75rem; }

/* Product page */
.variations, .variations tbody, .variations tr, .variations th, .variations td { text-align: right; }
.size-guide-close { margin-right: 0; margin-left: -.4rem; }
.size-guide__body th, .size-guide__body td { text-align: right; }
.woocommerce-product-attributes th, .woocommerce-product-attributes td { text-align: right; }
.woocommerce .select2-container--default .select2-selection--single .select2-selection__rendered { padding-left: 20px; padding-right: .4em; }

/* Mini-cart drawer slides in from the left (the end side) */
.mini-cart { right: auto; left: 0; transform: translateX(-100%); }
.mini-cart__close { margin-right: 0; margin-left: -.4rem; }
.mini-cart ul.woocommerce-mini-cart li.woocommerce-mini-cart-item { padding: 1rem 0 1rem 2rem; }
.mini-cart ul.woocommerce-mini-cart li.woocommerce-mini-cart-item img { float: right; margin: 0 0 .5rem 1rem; }
.mini-cart ul.woocommerce-mini-cart li.woocommerce-mini-cart-item a.remove { right: auto; left: 0; }

/* Cart */
html .woocommerce table.cart td.product-remove { padding-left: .5rem; padding-right: 0; }
html .woocommerce table.cart td.actions { text-align: left; }
html .woocommerce table.cart td.actions .coupon { float: right; }

/* Small screens: menu and filters slide in from the right (the start side) */
@media (max-width: 900px) {
  .nav-toggle { margin-left: 0; margin-right: -.6rem; }
  .primary-nav { left: auto; right: 0; transform: translateX(100%); }
  .primary-nav.is-open { transform: none; }
  .nav-close { margin: 0 -.6rem 1rem 0; }
  .primary-nav .sub-menu { padding: 0 1rem 0 0; }

  .shop-filters { left: auto; right: 0; padding-left: 1.5rem; padding-right: 1.5rem; transform: translateX(100%); }
  .shop-filters.is-open { transform: none; }
  .filters-close { margin-right: 0; margin-left: -.5rem; }
  .filters-done { left: auto; right: 0; }
}
@media (max-width: 768px) {
  html .woocommerce-cart-form table.cart tr.cart_item td { text-align: right !important; }
  html .woocommerce-cart-form table.cart tr.cart_item td.product-subtotal { text-align: left !important; }
  html .woocommerce table.cart td.actions { text-align: right !important; }
  html .woocommerce table.cart td.actions .coupon { float: none; }
}
@media (max-width: 640px) {
  .site-main .shop-toolbar .woocommerce-ordering { margin: 0; width: 100%; }
}

/* Arrows point the other way */
html[dir="rtl"] .icon-chevron { transform: scaleX(-1); }
html[dir="rtl"] .cat-nav--prev .icon-chevron { transform: none; }
html[dir="rtl"] .hero__links--pair a:first-child .icon-chevron { transform: none; }
