/* Mr. Engineering Theme V7.4.5 — Arabic header direction fix.
   Purpose: Arabic header must be RTL visually: logo on the right, nav centered, actions on the left.
   English remains LTR: logo left, actions right. */

/* Desktop and wide tablet header */
html[dir="rtl"] .mre-header .mre-header__inner,
body.rtl .mre-header .mre-header__inner{
  display:flex!important;
  direction:rtl!important;
  flex-direction:row!important;
}
html[dir="rtl"] .mre-header .mre-header__inner>.mre-logo,
html[dir="rtl"] .mre-header .mre-header__inner>.custom-logo-link,
body.rtl .mre-header .mre-header__inner>.mre-logo,
body.rtl .mre-header .mre-header__inner>.custom-logo-link{
  order:1!important;
  margin-inline-start:0!important;
  margin-inline-end:0!important;
  justify-self:end!important;
}
html[dir="rtl"] .mre-header .mre-header__inner>.mre-nav,
body.rtl .mre-header .mre-header__inner>.mre-nav{
  order:2!important;
  direction:rtl!important;
}
html[dir="rtl"] .mre-header .mre-header__inner>.mre-header__actions,
body.rtl .mre-header .mre-header__inner>.mre-header__actions{
  order:3!important;
  margin-inline-start:0!important;
  margin-inline-end:auto!important;
  direction:rtl!important;
  justify-self:start!important;
}
html[dir="rtl"] .mre-header .mre-header__tools,
body.rtl .mre-header .mre-header__tools{
  direction:rtl!important;
  flex-direction:row!important;
}

/* Keep English exactly as normal LTR */
html[dir="ltr"] .mre-header .mre-header__inner,
body.ltr .mre-header .mre-header__inner{
  display:flex!important;
  direction:ltr!important;
  flex-direction:row!important;
}
html[dir="ltr"] .mre-header .mre-header__inner>.mre-logo,
body.ltr .mre-header .mre-header__inner>.mre-logo{order:1!important;}
html[dir="ltr"] .mre-header .mre-header__inner>.mre-nav,
body.ltr .mre-header .mre-header__inner>.mre-nav{order:2!important;direction:ltr!important;}
html[dir="ltr"] .mre-header .mre-header__inner>.mre-header__actions,
body.ltr .mre-header .mre-header__inner>.mre-header__actions{order:3!important;margin-inline-start:auto!important;margin-inline-end:0!important;direction:ltr!important;}

/* Mobile/tablet compact header: logo right in Arabic, menu/actions left; English unchanged. */
@media (max-width:1024px){
  html[dir="rtl"] .mre-header .mre-header__inner,
  body.rtl .mre-header .mre-header__inner{
    display:grid!important;
    grid-template-columns:48px minmax(112px,1fr) 92px!important;
    direction:ltr!important; /* grid columns remain physical: 1 left / 3 right */
  }
  html[dir="rtl"] .mre-header .mre-header__inner>.mre-logo,
  body.rtl .mre-header .mre-header__inner>.mre-logo{
    grid-column:3!important;
    grid-row:1!important;
    justify-self:end!important;
    order:initial!important;
    direction:rtl!important;
    max-width:92px!important;
  }
  html[dir="rtl"] .mre-header .mre-header__inner>.mre-header__actions,
  body.rtl .mre-header .mre-header__inner>.mre-header__actions{
    display:contents!important;
    order:initial!important;
  }
  html[dir="rtl"] .mre-header .mre-menu-toggle,
  body.rtl .mre-header .mre-menu-toggle{
    grid-column:1!important;
    grid-row:1!important;
    justify-self:start!important;
  }
  html[dir="rtl"] .mre-header .mre-header__quote,
  body.rtl .mre-header .mre-header__quote{
    grid-column:2!important;
    grid-row:1!important;
    justify-self:center!important;
  }
}

@media (min-width:1025px) and (max-width:1280px){
  html[dir="rtl"] .mre-header .mre-header__inner,
  body.rtl .mre-header .mre-header__inner{
    display:flex!important;
    direction:rtl!important;
  }
  html[dir="rtl"] .mre-header .mre-header__inner>.mre-logo,
  body.rtl .mre-header .mre-header__inner>.mre-logo{order:1!important;}
  html[dir="rtl"] .mre-header .mre-header__inner>.mre-header__actions,
  body.rtl .mre-header .mre-header__inner>.mre-header__actions{order:3!important;margin-inline-end:auto!important;margin-inline-start:0!important;}
}
