/* FINAL Arabic header search fix
   Desktop visual order:
   [بحث] [input] [AR]
   Also prevents duplicate mobile search from appearing on desktop.
*/

/* Desktop: only desktop search is visible */
@media (min-width: 981px) {
  body .site-header .mobile-search {
    display: none !important;
  }

  body .site-header .desktop-search {
    display: flex !important;
  }

  html[lang="ar"] body .header-right {
    direction: ltr !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
  }

  html[lang="ar"] body .header-right .desktop-search {
    order: 1 !important;
    display: flex !important;
    flex-direction: row-reverse !important;
    direction: ltr !important;
  }

  html[lang="ar"] body .header-right .desktop-search input {
    direction: rtl !important;
    text-align: right !important;
  }

  html[lang="ar"] body .header-right .desktop-search button {
    direction: rtl !important;
    white-space: nowrap !important;
  }

  html[lang="ar"] body .header-right .language-select {
    order: 2 !important;
  }
}

/* Mobile/tablet: do not show the desktop search duplicate */
@media (max-width: 980px) {
  body .site-header .desktop-search {
    display: none !important;
  }

  body .site-header .mobile-search {
    display: flex !important;
  }

  html[lang="ar"] body .mobile-search {
    direction: ltr !important;
    flex-direction: row-reverse !important;
  }

  html[lang="ar"] body .mobile-search input {
    direction: rtl !important;
    text-align: right !important;
  }
}
