@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Plus+Jakarta+Sans:wght@400;600&display=swap');

:root {
    --font-arabic: 'Cairo', 'Plus Jakarta Sans', 'Helvetica Neue', Arial, sans-serif;
}

.mobile-only-divider {
  display: none;
}
@media (max-width: 992px) {
  .mobile-only-divider {
    display: block;
  }
}

.mobile-only-title {
  display: none;
}
@media (max-width: 992px) {
  .mobile-only-title {
    display: block;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 30px;
    line-height: 1.3;
    color: #0d0d0d;
    text-align: center;
  }
}

.mobile-title-wrapper {
  display: none;
}
@media (max-width: 992px) {
  .mobile-title-wrapper {
    display: block;
    padding: 20px 0 10px;
  }
}

/* Pages without mobile portrait hero need neutral spacing on mobile to avoid header overlap */
@media (max-width: 992px) {
  .no-mobile-hero .mil-content .mil-container {
    margin-top: 0 !important;
    padding-top: 60px;
  }
}

html[dir="rtl"], body[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] body {
    font-family: var(--font-arabic);
}

/* Adjust mil-content for RTL */
html[dir="rtl"] .mil-content {
    margin-left: 0; /* Align to available space */
    margin-right: 90px; /* Account for right-sided left-panel */
    width: calc(100% - 90px);
}

/* Adjust mil-scroll-wrapper .mil-container for RTL */
html[dir="rtl"] .mil-content .mil-scroll-wrapper .mil-container {
    padding-left: 90px; /* Mirror LTR gutters to respect hero space */
    padding-right: 90px; /* Keep offset from sidebar */
    width: calc(63% + 1px); /* Match LTR content width */
}

/* Mobile: reset to full-width layout like LTR */
@media (max-width: 1200px) {
    html[dir="rtl"] .mil-content {
        margin-right: 0;
        width: 100%;
    }
    html[dir="rtl"] .mil-content .mil-scroll-wrapper .mil-container {
        padding-left: 30px;
        padding-right: 30px;
        width: 100%;
        max-width: none;
    }
}

/* Adjust mil-section-title for RTL */
html[dir="rtl"] .mil-section-title h3 {
    margin-left: auto; /* Revert default LTR margin-left */
    margin-right: 50%; /* Center again */
    transform: translateX(50%); /* Adjust transform for RTL centering */
    text-align: right; /* Ensure text alignment for title */
    padding-left: 30px; /* Adjust padding for RTL */
    padding-right: 0; /* Remove LTR padding */
}

html[dir="rtl"] .mil-section-title.mil-left h3 {
    margin-right: 0; /* Reset previous override */
    padding-left: 30px; /* Adjust for RTL */
    padding-right: 0; /* Remove LTR padding */
    text-align: right;
    transform: translateX(0);
}

/* Adjust mil-page-name in mil-left-panel for RTL */
html[dir="rtl"] .mil-left-panel .mil-page-name {
    transform: rotate(-90deg) translateX(140px); /* Adjust translateX to push away from right edge */
    text-align: left; /* Adjust text alignment */
}

html[dir="rtl"] .mil-top-panel,
html[dir="rtl"] .mil-navigation ul,
html[dir="rtl"] .mil-back-to-top,
html[dir="rtl"] .mil-breadcrumbs,
html[dir="rtl"] .mil-left-panel,
html[dir="rtl"] .mil-banner-title,
html[dir="rtl"] .mil-section-title,
html[dir="rtl"] .mil-center,
html[dir="rtl"] .mil-right {
    text-align: right;
}

html[dir="rtl"] .mil-navigation ul {
    direction: rtl;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

html[dir="rtl"] .mil-navigation nav {
    justify-content: flex-end;
    text-align: right;
}

/* Reverse menu item order and fix spacing/active marker for RTL */
html[dir="rtl"] .mil-navigation nav ul {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

/* Stronger override for header nav to ensure menu items reverse */
html[dir="rtl"] .mil-top-panel .mil-navigation nav ul,
html[dir="rtl"] .mil-top-panel .mil-navigation ul {
    flex-direction: row-reverse;
}

html[dir="rtl"] .mil-navigation nav ul li {
    margin-left: 24px;
    margin-right: 0;
}

html[dir="rtl"] .mil-navigation nav ul li:last-child {
    margin-left: 0;
}

html[dir="rtl"] .mil-navigation nav ul li.mil-active > a:before {
    left: auto;
    right: -5px;
    margin-right: 0;
    margin-left: 10px;
}

html[dir="rtl"] .mil-top-panel .mil-navigation ul {
    justify-content: flex-end;
}

html[dir="rtl"] .mil-top-panel {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

html[dir="rtl"] .mil-top-panel .mil-top-panel-btns {
    order: initial;
    flex-direction: row;
    margin: 0;
}

html[dir="rtl"] .mil-navigation {
    order: initial;
    margin: 0;
}

html[dir="rtl"] .mil-logo {
    order: initial;
    margin: 0;
}

html[dir="rtl"] .mil-top-panel .mil-top-panel-btns .mil-contact-btn {
    margin-left: 0;
    margin-right: 0;
}

html[dir="rtl"] .mil-navigation ul li {
    margin-right: 0;
    margin-left: 24px;
}

html[dir="rtl"] .mil-navigation ul li ul {
    text-align: right;
}

html[dir="rtl"] .mil-navigation ul li ul li {
    margin-right: 0;
}

html[dir="rtl"] .mil-navigation a {
    font-size: 17px;
    letter-spacing: 0.4px;
}

/* Ensure mobile menu stacks vertically in RTL, same as LTR */
@media (max-width: 1200px) {
    html[dir="rtl"] .mil-navigation nav ul {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    html[dir="rtl"] .mil-navigation nav ul li {
        margin: 0 0 15px 0 !important;
        width: 100%;
        flex-direction: column;
    }
    html[dir="rtl"] .mil-navigation nav ul li:last-child {
        margin-bottom: 0 !important;
    }
}

/* Nudge RTL top bar inward on mobile so items aren't flush to the edge */
@media (max-width: 1200px) {
    html[dir="rtl"] .mil-top-panel {
        padding-left: 20px;
    }
    html[dir="rtl"] .mil-top-panel .mil-top-panel-btns {
        gap: 14px;
    }
    html[dir="rtl"] .mil-top-panel .mil-menu-btn {
        margin-left: 6px;
    }
}

/* Keep button order as written (lang switch then login) on RTL */
html[dir="rtl"] .mil-top-panel {
    flex-direction: row;
}

html[dir="rtl"] .mil-top-panel .mil-top-panel-btns {
    flex-direction: row;
}

html[dir="rtl"] .mil-left-panel {
    left: auto;
    right: 0;
    margin-top: 80px; /* Drop below the header in RTL */
}

/* Move hero/placeholder imagery to the left on RTL */
html[dir="rtl"] .mil-right-banner {
    right: auto;
    left: 0;
}
html[dir="rtl"] .mil-banner-wrapper {
    left: 0;
    right: auto;
}

html[dir="rtl"] .mil-back-to-top svg,
html[dir="rtl"] .mil-reviews-prev svg,
html[dir="rtl"] .mil-reviews-next svg {
    transform: scaleX(-1);
}

html[dir="rtl"] .mil-breadcrumbs {
    justify-content: flex-end;
}

html[dir="rtl"] .mil-breadcrumbs li {
    margin-left: 12px;
    margin-right: 0;
}

html[dir="rtl"] .mil-breadcrumbs li:after {
    transform: scaleX(-1);
    left: -12px;
    right: auto;
}

html[dir="rtl"] .mil-banner-title h1,
html[dir="rtl"] .mil-banner-title h2,
html[dir="rtl"] .mil-banner-title h3,
html[dir="rtl"] .mil-banner-title p {
    direction: rtl;
}

/* Center text elements inside main content for RTL */
html[dir="rtl"] .mil-content .mil-container h1,
html[dir="rtl"] .mil-content .mil-container h2,
html[dir="rtl"] .mil-content .mil-container h3,
html[dir="rtl"] .mil-content .mil-container h4,
html[dir="rtl"] .mil-content .mil-container h5,
html[dir="rtl"] .mil-content .mil-container h6,
html[dir="rtl"] .mil-content .mil-container p {
    text-align: center;
}

/* Center CTA blocks (e.g., contact button) in RTL */
html[dir="rtl"] .mil-content .mil-container .mil-center {
    text-align: center;
}

html[dir="rtl"] .mil-content .mil-container .mil-center > * {
    margin-left: auto;
    margin-right: auto;
}

html[dir="rtl"] .mil-content .mil-container .mil-center .mil-btn {
    display: inline-flex;
    justify-content: center;
}

/* Center call-to-action buttons, icon links, quotes, and signature for RTL */
html[dir="rtl"] .mil-content .mil-container .mil-btn,
html[dir="rtl"] .mil-content .mil-container .mil-link.mil-icon-link,
html[dir="rtl"] .mil-content .mil-container .mil-service-icon,
html[dir="rtl"] .mil-content .mil-container .mil-quote {
    display: inline-flex;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

html[dir="rtl"] .mil-content .mil-container .mil-sign {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

html[dir="rtl"] .mil-icon-box,
html[dir="rtl"] .mil-review,
html[dir="rtl"] .mil-timeline li {
    text-align: right;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .mil-link svg,
html[dir="rtl"] .mil-icon-link svg {
    transform: scaleX(-1);
}

.mil-lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Pull the switch left on LTR so it doesn't sit under the login button */
html[dir="ltr"] .mil-lang-switch {
    margin-right: 14px;
}

/* Add breathing room between login and lang switch on RTL */
html[dir="rtl"] .mil-top-panel .mil-lang-switch {
    margin-left: 14px;
}

/* Footer full-bleed with sidebar offset for RTL */
.mil-lang-switch a {
    color: #0d0d0d;
    text-decoration: none;
    opacity: 0.65;
}

.mil-lang-switch a.active {
    opacity: 1;
}

.mil-lang-switch .divider {
    color: #8f8f8f;
}

@media (max-width: 991px) {
    html[dir="rtl"] .mil-left-panel {
        right: auto;
    }
}
