/**
 * CloudTail :: RTL overlay
 *
 * Loaded only when <html dir="rtl"> (Farsi, Arabic, Hebrew, Urdu, …).
 * Base cloudtail.css is direction-aware (logical sidebar/offset/fonts).
 * This file mirrors leftover physical left/right rules and Bootstrap/WHMCS quirks.
 */

/* -------------------------------------------------------------------------
   Typography — reinforce CSS variables so .agw p/a/button/span pick up Yekan
   ------------------------------------------------------------------------- */
body {
  text-align: right;
}

html[dir="rtl"].ct-font-fa,
html[dir="rtl"].ct-font-fa body,
body.ct-font-fa {
  --ct-font-ui: 'YekanBakh', 'PlusJakartaSansVF', Tahoma, system-ui, sans-serif !important;
  --ct-font-display: 'YekanBakh', 'PlusJakartaSansVF', Tahoma, system-ui, sans-serif !important;
  font-family: var(--ct-font-ui) !important;
}

html[dir="rtl"].ct-font-fa .agw p,
html[dir="rtl"].ct-font-fa .agw a,
html[dir="rtl"].ct-font-fa .agw button,
html[dir="rtl"].ct-font-fa .agw label,
html[dir="rtl"].ct-font-fa .agw span,
html[dir="rtl"].ct-font-fa .agw li,
html[dir="rtl"].ct-font-fa .agw input,
html[dir="rtl"].ct-font-fa .agw select,
html[dir="rtl"].ct-font-fa .agw textarea,
html[dir="rtl"].ct-font-fa .agw .btn,
html[dir="rtl"].ct-font-fa .agw a.btn,
html[dir="rtl"].ct-font-fa .agw button.btn,
html[dir="rtl"].ct-font-fa .plusJakartaSans,
html[dir="rtl"].ct-font-fa .ct-cart,
html[dir="rtl"].ct-font-fa .ct-cart p,
html[dir="rtl"].ct-font-fa .ct-cart a,
html[dir="rtl"].ct-font-fa .ct-cart button,
html[dir="rtl"].ct-font-fa .ct-cart label,
html[dir="rtl"].ct-font-fa .ct-cart span,
html[dir="rtl"].ct-font-fa .ct-cart li,
html[dir="rtl"].ct-font-fa .ct-cart input,
html[dir="rtl"].ct-font-fa .ct-cart select,
html[dir="rtl"].ct-font-fa .ct-cart textarea,
html[dir="rtl"].ct-font-fa .ct-cart .btn,
html[dir="rtl"].ct-font-fa #order-standard_cart,
html[dir="rtl"].ct-font-fa #order-standard_cart .btn,
html[dir="rtl"].ct-font-fa #order-standard_cart a.btn,
html[dir="rtl"].ct-font-fa #order-standard_cart button.btn,
html[dir="rtl"].ct-font-fa #order-standard_cart input.btn {
  font-family: 'YekanBakh', 'PlusJakartaSansVF', Tahoma, system-ui, sans-serif !important;
}

html[dir="rtl"].ct-font-fa .agw :is(h1, h2, h3, h4, h5, h6),
html[dir="rtl"].ct-font-fa .clashDisplay,
html[dir="rtl"].ct-font-fa .agw .ct-home-hero-title,
html[dir="rtl"].ct-font-fa .agw .ct-home-hero-title span,
html[dir="rtl"].ct-font-fa .agw .ct-home-domain-title,
html[dir="rtl"].ct-font-fa .agw .ct-home-domain-title span,
html[dir="rtl"].ct-font-fa .ct-cart :is(h1, h2, h3, h4, h5, h6),
html[dir="rtl"].ct-font-fa #order-standard_cart :is(h1, h2, h3, h4, h5, h6) {
  font-family: 'YekanBakh', 'PlusJakartaSansVF', Tahoma, system-ui, sans-serif !important;
  letter-spacing: normal !important;
}

/* Yekan weights — Farsi / Arabic only */
html[dir="rtl"].ct-font-fa :is(h1, h2),
html[dir="rtl"].ct-font-fa .agw :is(h1, h2),
html[dir="rtl"].ct-font-fa .ct-cart :is(h1, h2),
html[dir="rtl"].ct-font-fa #order-standard_cart :is(h1, h2) {
  font-weight: 900 !important;
}

html[dir="rtl"].ct-font-fa :is(h3, h4, h5, h6),
html[dir="rtl"].ct-font-fa .agw :is(h3, h4, h5, h6),
html[dir="rtl"].ct-font-fa .ct-cart :is(h3, h4, h5, h6),
html[dir="rtl"].ct-font-fa #order-standard_cart :is(h3, h4, h5, h6) {
  font-weight: 700 !important;
}

/* -------------------------------------------------------------------------
   Shell / chrome already mostly logical — reinforce drawer transform origin
   ------------------------------------------------------------------------- */
html[dir="rtl"] .ct-sidebar--drawer {
  box-shadow: -25px 0 50px -12px rgb(0 0 0 / 0.25);
}

/* Keep anchored popovers inside the viewport when the action bar is on the left. */
html[dir="rtl"] .ct-topbar-dropdown-panel {
  right: auto !important;
  left: 0 !important;
  max-width: calc(100vw - 1rem);
}

html[dir="rtl"] .ct-sidebar .fi-rr-angle-small-down.-rotate-90 {
  rotate: 90deg !important;
}

/* Bound guest mega menus to the padded header width on narrow screens. */
html[dir="rtl"] .ct-guest-header [x-show="megaMenuOpen"],
html[dir="rtl"] .ct-guest-header [x-show="activeMenu"] {
  max-width: 100%;
  box-sizing: border-box;
}

/* Flip directional icons that point “forward” in chrome */
html[dir="rtl"] .fi-rr-arrow-right,
html[dir="rtl"] .fi-rr-angle-small-right,
html[dir="rtl"] .fi-rr-caret-right,
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .fa-angle-right,
html[dir="rtl"] .fa-chevron-right {
  rotate: 180deg;
}

html[dir="rtl"] .fi-rr-arrow-left,
html[dir="rtl"] .fi-rr-angle-small-left,
html[dir="rtl"] .fi-rr-caret-left,
html[dir="rtl"] .fa-arrow-left,
html[dir="rtl"] .fa-angle-left,
html[dir="rtl"] .fa-chevron-left {
  rotate: 180deg;
}

/* -------------------------------------------------------------------------
   Bootstrap 4 / WHMCS leftovers inside the client area
   ------------------------------------------------------------------------- */
html[dir="rtl"] .float-left { float: right !important; }
html[dir="rtl"] .float-right { float: left !important; }

html[dir="rtl"] .text-left { text-align: right !important; }
html[dir="rtl"] .text-right { text-align: left !important; }

html[dir="rtl"] .ml-auto { margin-left: unset !important; margin-right: auto !important; }
html[dir="rtl"] .mr-auto { margin-right: unset !important; margin-left: auto !important; }

html[dir="rtl"] .pl-0 { padding-left: unset !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-0 { padding-right: unset !important; padding-left: 0 !important; }

html[dir="rtl"] .dropdown-menu {
  text-align: right;
  left: auto !important;
  right: 0 !important;
}

html[dir="rtl"] .dropdown-menu-right {
  right: auto !important;
  left: 0 !important;
}

html[dir="rtl"] .modal-header .close,
html[dir="rtl"] .modal-header .btn-close {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .input-group > .form-control:not(:last-child),
html[dir="rtl"] .input-group > .custom-select:not(:last-child) {
  border-radius: 0 0.375rem 0.375rem 0;
}

html[dir="rtl"] .input-group > .input-group-append > .btn,
html[dir="rtl"] .input-group > .input-group-append > .input-group-text {
  border-radius: 0.375rem 0 0 0.375rem;
}

html[dir="rtl"] .list-unstyled,
html[dir="rtl"] .list-inline {
  padding-right: 0;
  padding-left: unset;
}

html[dir="rtl"] .breadcrumb-item + .breadcrumb-item {
  padding-left: 0;
  padding-right: 0.5rem;
}

html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  float: right;
  padding-left: 0.5rem;
  padding-right: 0;
}

/* DataTables / WHMCS tables */
html[dir="rtl"] table.dataTable thead th,
html[dir="rtl"] table.dataTable thead td {
  text-align: right;
}

html[dir="rtl"] .dataTables_wrapper .dataTables_filter {
  text-align: right;
}

html[dir="rtl"] .dataTables_wrapper .dataTables_filter input {
  margin-left: 0;
  margin-right: 0.5em;
}

/* Form checks — keep control on the start edge */
html[dir="rtl"] .custom-control {
  padding-left: 0;
  padding-right: 1.5rem;
}

html[dir="rtl"] .custom-control-label::before,
html[dir="rtl"] .custom-control-label::after {
  left: auto;
  right: -1.5rem;
}

html[dir="rtl"] .form-check {
  padding-left: 0;
  padding-right: 1.25em;
}

html[dir="rtl"] .form-check .form-check-input {
  float: right;
  margin-left: 0;
  margin-right: -1.25em;
}

/* Keep ticket rating stars LTR so glyphs stay in visual order */
html[dir="rtl"] .ticket-rating,
html[dir="rtl"] .rate,
html[dir="rtl"] [class*="rating"] {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Absolute-positioned search / field icons that use left: */
html[dir="rtl"] .agw .absolute.left-3,
html[dir="rtl"] .agw .absolute.left-4,
html[dir="rtl"] .agw .absolute.left-2,
html[dir="rtl"] .agw .absolute.left-0 {
  left: auto;
  right: 0.5rem;
}

html[dir="rtl"] .agw .absolute.left-0 {
  right: 0;
}

html[dir="rtl"] .agw .absolute.left-3 {
  right: 0.75rem;
}

html[dir="rtl"] .agw .absolute.left-4 {
  right: 1rem;
}

html[dir="rtl"] .agw .absolute.left-3\.5 {
  left: auto;
  right: 0.875rem;
}

html[dir="rtl"] .agw .absolute.right-3,
html[dir="rtl"] .agw .absolute.right-4,
html[dir="rtl"] .agw .absolute.right-2,
html[dir="rtl"] .agw .absolute.right-1,
html[dir="rtl"] .agw .absolute.right-0,
html[dir="rtl"] .agw .absolute.-right-2,
html[dir="rtl"] .agw .absolute.-right-0\.5 {
  right: auto;
  left: 0.5rem;
}

html[dir="rtl"] .agw .absolute.right-0 {
  left: 0;
}

html[dir="rtl"] .agw .absolute.-right-2 {
  left: -0.5rem;
}

html[dir="rtl"] .agw .absolute.-right-0\.5 {
  left: -0.125rem;
}

html[dir="rtl"] .agw .absolute.right-3 {
  left: 0.75rem;
}

html[dir="rtl"] .agw .absolute.right-4 {
  left: 1rem;
}

html[dir="rtl"] .agw .pl-10,
html[dir="rtl"] .agw .pl-11,
html[dir="rtl"] .agw .pl-12 {
  padding-left: unset;
  padding-right: 2.75rem;
}

html[dir="rtl"] .agw .pr-4 {
  padding-right: unset;
  padding-left: 1rem;
}

/* Space utilities commonly used for icon+label rows */
html[dir="rtl"] .agw .ml-1 { margin-left: unset; margin-right: 0.25rem; }
html[dir="rtl"] .agw .ml-2 { margin-left: unset; margin-right: 0.5rem; }
html[dir="rtl"] .agw .ml-3 { margin-left: unset; margin-right: 0.75rem; }
html[dir="rtl"] .agw .mr-1 { margin-right: unset; margin-left: 0.25rem; }
html[dir="rtl"] .agw .mr-2 { margin-right: unset; margin-left: 0.5rem; }
html[dir="rtl"] .agw .mr-3 { margin-right: unset; margin-left: 0.75rem; }

html[dir="rtl"] .agw .rounded-l-xl,
html[dir="rtl"] .agw .rounded-l-2xl,
html[dir="rtl"] .agw .rounded-l-3xl {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 1rem;
  border-bottom-right-radius: 1rem;
}

html[dir="rtl"] .agw .rounded-r-xl,
html[dir="rtl"] .agw .rounded-r-2xl,
html[dir="rtl"] .agw .rounded-r-3xl {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 1rem;
  border-bottom-left-radius: 1rem;
}

html[dir="rtl"] .agw .rounded-l-full {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 9999px;
  border-bottom-right-radius: 9999px;
}

html[dir="rtl"] .agw .rounded-r-full {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 9999px;
  border-bottom-left-radius: 9999px;
}

html[dir="rtl"] .agw .text-left { text-align: right; }
html[dir="rtl"] .agw .text-right { text-align: left; }

html[dir="rtl"] .agw .border-l { border-left: 0; border-right-width: 1px; }
html[dir="rtl"] .agw .border-r { border-right: 0; border-left-width: 1px; }

/* Mirror fixed-position artwork and the domain search control. */
html[dir="rtl"] .ct-home-btn-text {
  margin-left: 0;
  margin-right: 0.5rem;
}

html[dir="rtl"] .ct-home-section-head--on-dark {
  text-align: right;
}

html[dir="rtl"] .ct-auth-form-body {
  text-align: right;
}

html[dir="rtl"] :is(input[type="email"], input[type="number"], input[type="password"], input[type="tel"], input[type="url"], input[name*="domain"], input[id*="domain"], input[name*="ccnumber"], input[id*="ccnumber"], input[id*="CardNumber"]) {
  direction: ltr;
  text-align: left;
}

html[dir="rtl"] .ct-home-hero-badge {
  padding-left: 0.85rem;
  padding-right: 0.4rem;
}

html[dir="rtl"] .ct-home-hero-badge-lines {
  right: auto;
  left: -120px;
}

html[dir="rtl"] .ct-home-domain-deco--right {
  right: auto;
  left: -0.5rem;
}

html[dir="rtl"] .ct-home-domain-deco--left {
  left: auto;
  right: -0.5rem;
}

html[dir="rtl"] .ct-home-domain-field i {
  left: auto;
  right: 1.1rem;
}

html[dir="rtl"] .ct-home-domain-field input {
  padding-left: 7.5rem;
  padding-right: 3rem;
  direction: ltr;
  text-align: left;
}

html[dir="rtl"] .ct-home-domain-field button {
  right: auto;
  left: 0.5rem;
}

html[dir="rtl"] .ct-home-products-deco {
  right: auto;
  left: -75px;
}

html[dir="rtl"] .ct-home-cta-orb--purple {
  right: auto;
  left: -2rem;
}

html[dir="rtl"] .ct-home-cta-orb--orange {
  left: auto;
  right: -2rem;
}

html[dir="rtl"] .ct-auth-hero-deco--cloud {
  right: auto;
  left: 0;
}

html[dir="rtl"] .ct-auth-hero-deco--orb {
  left: auto;
  right: -4rem;
}

@media (min-width: 768px) {
  html[dir="rtl"] .ct-home-domain-deco--right {
    left: 4rem;
  }

  html[dir="rtl"] .ct-home-domain-deco--left {
    right: 4rem;
  }

  html[dir="rtl"] .ct-home-products-deco {
    left: -50px;
  }

  html[dir="rtl"] .ct-home-products-head {
    margin-left: 2.5rem;
    margin-right: 0;
  }

  html[dir="rtl"] .ct-app-footer-copy {
    text-align: right;
  }
}

html[dir="rtl"] .ct-mobile-drawer .ml-14 {
  margin-left: 0;
  margin-right: 3.5rem;
}

/* Auth side panels — keep art on the visual “outer” edge */
html[dir="rtl"] .ct-auth-shell .order-1 { order: 2; }
html[dir="rtl"] .ct-auth-shell .order-2 { order: 1; }

@media (min-width: 1024px) {
  html[dir="rtl"] .ct-auth-shell .lg\:order-1 { order: 2; }
  html[dir="rtl"] .ct-auth-shell .lg\:order-2 { order: 1; }
}
