/*
Theme Name: Aigenix
Description: RTL adjustments for Aigenix.
*/

body {
  direction: rtl;
  unicode-bidi: embed;
}

.aigenix-skip-link:focus {
  right: var(--av-space-4);
  left: auto;
}

.aigenix-back-to-top {
  right: auto;
  left: var(--av-space-5);
}

.av-avatar-group .av-avatar + .av-avatar {
  margin-right: -0.75rem;
  margin-left: 0;
}

.av-prose :where(ul, ol) {
  padding-right: var(--av-space-6);
  padding-left: 0;
}

.aigenix-menu--primary .sub-menu {
  right: 0;
  left: auto;
}

.aigenix-desktop-menu ul.sub-menu {
  text-align: right;
}

.aigenix-desktop-menu ul.sub-menu ul.sub-menu {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: 8px;
}

.aigenix-desktop-menu li.menu-item-has-children > a::after,
.aigenix-desktop-menu li.menu-item-has-megamenu > a::after {
  margin-left: 0;
  margin-right: 6px;
}

.aigenix-menu-icon-span {
  margin-right: 0;
  margin-left: 6px;
}

.aigenix-menu-icon-span {
  margin-right: 0;
  margin-left: 6px;
}

/* WooCommerce Cart & Checkout RTL Fixes */
.woocommerce-cart table.shop_table.cart th,
.woocommerce-cart table.shop_table.cart td,
.woocommerce-checkout table.shop_table th,
.woocommerce-checkout table.shop_table td,
.woocommerce-order table.shop_table th,
.woocommerce-order table.shop_table td,
.woocommerce div.product form.cart table.variations th,
.woocommerce div.product form.cart table.variations td {
  text-align: right;
}

.woocommerce-cart table.shop_table.cart td.actions .coupon {
  float: right;
}

.woocommerce-cart table.shop_table.cart td.actions > button.button,
.woocommerce-cart table.shop_table.cart td.actions > input.button {
  float: left;
}

.woocommerce-cart .cart-collaterals .cart_totals table th,
.woocommerce-checkout table.shop_table tfoot th,
.woocommerce-order table.shop_table tfoot th {
  text-align: right;
}

.woocommerce-cart .cart-collaterals .cart_totals table td,
.woocommerce-checkout table.shop_table td.product-total,
.woocommerce-checkout table.shop_table th.product-total,
.woocommerce-checkout table.shop_table tfoot td,
.woocommerce-order table.shop_table tfoot td {
  text-align: left;
}

.quantity input.qty {
  text-align: center !important;
}

.aigenix-menu--mobile .sub-menu {
  padding-right: var(--av-space-4);
  padding-left: 0;
}

/* Portfolio Single RTL */
.related-read-more::after {
  content: '←';
}

.related-portfolio-card:hover .related-read-more::after {
  transform: translateX(-4px);
}

/* --------------------------------------
   Single Post & Archive Overrides
--------------------------------------- */

.aigenix-entry-content {
  text-align: right !important;
  direction: rtl !important;
}

/* Code and Pre blocks should usually remain LTR even in RTL */
.aigenix-entry-content pre,
.aigenix-entry-content code {
  text-align: left !important;
  direction: ltr !important;
}

.aigenix-entry-content blockquote {
  border-right: 4px solid var(--av-color-brand) !important;
  border-left: none !important;
  text-align: right !important;
  padding: 1.5rem 2.25rem 1.5rem 1.75rem !important;
}

.aigenix-entry-content blockquote::before {
  right: 1rem !important;
  left: auto !important;
}

.aigenix-entry-content blockquote p,
.aigenix-entry-content blockquote cite {
  text-align: right !important;
}

/* Post Navigation (Prev/Next) RTL Support */
.post-navigation .nav-links {
  display: flex !important;
  justify-content: space-between !important;
  width: 100% !important;
  gap: 1rem;
}
.post-navigation .nav-previous,
.post-navigation .nav-next {
  flex: 1;
}
.post-navigation .nav-previous {
  text-align: right !important;
}
.post-navigation .nav-next {
  text-align: left !important;
}
.post-navigation a {
  display: inline-flex !important;
  width: auto;
}

.aigenix-comment-form .comment-form-cookies-consent {
  flex-direction: row-reverse !important;
}

.aigenix-entry-content.aigenix-entry-content-single ul,
.aigenix-entry-content.aigenix-entry-content-single ol {
  margin: 1.25rem 1.5rem 1.25rem 0 !important;
  text-align: right !important;
}

.aigenix-entry-content.aigenix-entry-content-single ul li {
  padding-right: 1.5rem !important;
  padding-left: 0 !important;
  text-align: right !important;
}

.aigenix-entry-content ul:not(.elementor-editor-element-settings) li::before {
  right: 0 !important;
  left: auto !important;
}

.aigenix-entry-content.aigenix-entry-content-single ol li {
  padding-right: 0.25rem !important;
  padding-left: 0 !important;
  text-align: right;
}

.aigenix-entry-content th,
.aigenix-entry-content td,
.aigenix-entry-content p {
  text-align: right;
}

.aigenix-entry-content .alignleft {
  float: right;
  margin: 0.5rem 0 1rem 1.5rem;
}

.aigenix-entry-content .alignright {
  float: left;
  margin: 0.5rem 1.5rem 1rem 0;
}

/* Archives Grid Adjustments (if any) */
.aigenix-post-card-content,
.aigenix-archive-card-content {
  text-align: right;
}
