/**
 * Arabic / RTL layout for every common mobile and tablet width.
 * Desktop Arabic (above 1024px) keeps the original stylesheet.
 */

html[dir="rtl"],
body.qta-rtl,
body.qta-lang-ar {
  overflow-x: clip;
  max-width: 100%;
}

html[dir="rtl"] .alignfull,
body.qta-rtl .alignfull {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

html[dir="rtl"] .qta-header__inner,
body.qta-rtl .qta-header__inner,
html[dir="rtl"] .qta-logo,
body.qta-rtl .qta-logo,
html[dir="rtl"] .qta-logo__text,
body.qta-rtl .qta-logo__text,
html[dir="rtl"] .qta-container,
body.qta-rtl .qta-container {
  min-width: 0;
  max-width: 100%;
}

/* Never widen the hero copy: its 48rem cap keeps the desktop layout intact. */
html[dir="rtl"] .qta-hero__copy,
body.qta-rtl .qta-hero__copy {
  min-width: 0;
}

html[dir="rtl"] .qta-hero__title,
body.qta-rtl .qta-hero__title,
html[dir="rtl"] .qta-hero__subtitle,
body.qta-rtl .qta-hero__subtitle {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Shared mobile / tablet Arabic layout */
@media (max-width: 1024px) {
  html[dir="rtl"] body,
  body.qta-rtl,
  body.qta-lang-ar {
    width: 100%;
    max-width: 100%;
    overflow-x: clip !important;
    overflow-y: auto !important;
  }

  html[dir="rtl"] body.qta-front-page,
  body.qta-front-page.qta-rtl,
  body.qta-front-page.qta-lang-ar {
    background: #083c2b !important;
  }

  html[dir="rtl"] body.qta-front-page .qta-header,
  body.qta-front-page.qta-rtl .qta-header,
  body.qta-front-page.qta-lang-ar .qta-header,
  html[dir="rtl"] body.qta-front-page .qta-header.is-scrolled,
  body.qta-front-page.qta-rtl .qta-header.is-scrolled {
    background: rgba(8, 60, 43, 0.98) !important;
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
  }

  html[dir="rtl"] body.qta-front-page .qta-logo__name,
  html[dir="rtl"] body.qta-front-page .qta-nav-toggle,
  body.qta-front-page.qta-rtl .qta-logo__name,
  body.qta-front-page.qta-rtl .qta-nav-toggle,
  html[dir="rtl"] body.qta-front-page .qta-lang-switch {
    color: #fff !important;
  }

  html[dir="rtl"] body.qta-front-page .qta-logo__tagline,
  body.qta-front-page.qta-rtl .qta-logo__tagline {
    color: #d4af37 !important;
  }

  html[dir="rtl"] body.qta-front-page .qta-lang-switch,
  body.qta-front-page.qta-rtl .qta-lang-switch {
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #fff !important;
  }

  html[dir="rtl"] .qta-main,
  body.qta-rtl .qta-main,
  body.qta-lang-ar .qta-main {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    overflow: visible !important;
  }

  html[dir="rtl"] .qta-hero,
  body.qta-rtl .qta-hero,
  body.qta-lang-ar .qta-hero {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 100svh !important;
    margin: 0 !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: linear-gradient(135deg, #083c2b 0%, #0f6b4f 45%, #083c2b 100%) !important;
    color: #fff !important;
  }

  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content,
  html[dir="rtl"] .qta-hero__copy,
  body.qta-rtl .qta-hero__copy {
    display: block !important;
    min-width: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  html[dir="rtl"] .qta-reveal,
  body.qta-rtl .qta-reveal {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    animation: none !important;
  }

  html[dir="rtl"] .qta-hero__ctas,
  body.qta-rtl .qta-hero__ctas {
    display: flex !important;
  }

  html[dir="rtl"] .qta-hero__tags,
  body.qta-rtl .qta-hero__tags {
    display: grid !important;
  }

  html[dir="rtl"] .qta-section,
  body.qta-rtl .qta-section,
  html[dir="rtl"] .qta-trust,
  body.qta-rtl .qta-trust,
  html[dir="rtl"] .qta-page-hero,
  body.qta-rtl .qta-page-hero {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
}

/*
 * Arabic labels are wider than their English counterparts, so the inline nav
 * and header buttons no longer fit next to the logo below 1024px. Keep the
 * hamburger instead of letting the header overflow off-canvas.
 */
@media (max-width: 1024px) {
  html[dir="rtl"] .qta-nav,
  body.qta-rtl .qta-nav,
  html[dir="rtl"] .qta-header__actions,
  body.qta-rtl .qta-header__actions {
    display: none !important;
  }

  html[dir="rtl"] .qta-header__mobile-tools,
  body.qta-rtl .qta-header__mobile-tools,
  html[dir="rtl"] .qta-nav-toggle,
  body.qta-rtl .qta-nav-toggle {
    display: flex !important;
  }
}

/* 320 — iPhone SE 1 / Galaxy Fold cover */
@media (max-width: 320px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 1.5rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 5.25rem 0 2.25rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 1.7rem; }
  html[dir="rtl"] .qta-hero__subtitle,
  body.qta-rtl .qta-hero__subtitle { font-size: 0.92rem; }
  html[dir="rtl"] .qta-hero__tags,
  body.qta-rtl .qta-hero__tags { grid-template-columns: 1fr; }
  html[dir="rtl"] .qta-logo__name,
  body.qta-rtl .qta-logo__name { font-size: 0.72rem; }
}

/* 360 — Android compact */
@media (min-width: 321px) and (max-width: 359px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 1.6rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 5.5rem 0 2.5rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 1.8rem; }
}

/* 375 — iPhone SE 2/3 */
@media (min-width: 360px) and (max-width: 374px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 1.75rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 5.75rem 0 2.75rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 1.9rem; }
}

@media (min-width: 375px) and (max-width: 389px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 2rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 6rem 0 3rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 2rem; }
}

/* 390 / 393 — iPhone 12-14 / Pixel */
@media (min-width: 390px) and (max-width: 413px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 2rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 6.25rem 0 3.25rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 2.1rem; }
}

/* 414 — iPhone Plus */
@media (min-width: 414px) and (max-width: 427px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 2.25rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 6.5rem 0 3.5rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 2.2rem; }
}

/* 428 / 430 — iPhone Pro Max */
@media (min-width: 428px) and (max-width: 479px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 2.25rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 6.75rem 0 3.75rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 2.25rem; }
}

/* 480 — large phones / SE landscape */
@media (min-width: 480px) and (max-width: 539px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 2.5rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 7rem 0 4rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 2.35rem; }
}

/* 540 / 600 */
@media (min-width: 540px) and (max-width: 639px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 2.75rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 7.25rem 0 4.25rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 2.5rem; }
}

/* 640 */
@media (min-width: 640px) and (max-width: 667px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 3rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 7.5rem 0 4.5rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 2.65rem; }
}

/* 668 / 720 / 736 — large phones landscape */
@media (min-width: 668px) and (max-width: 767px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 3rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 7.75rem 0 4.75rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 2.75rem; }
}

/* 768 — iPad mini / large phones landscape */
@media (min-width: 768px) and (max-width: 819px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 3.25rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 8rem 0 5rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 2.9rem; }
}

/* 820 / 834 — iPad Air */
@media (min-width: 820px) and (max-width: 899px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 3.5rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 8.5rem 0 5.5rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 3.1rem; }
}

/* 900 / 1024 — iPad portrait */
@media (min-width: 900px) and (max-width: 1024px) {
  html[dir="rtl"] .qta-container,
  body.qta-rtl .qta-container { width: calc(100% - 4rem); }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content { padding: 9rem 0 6rem; }
  html[dir="rtl"] .qta-hero__title,
  body.qta-rtl .qta-hero__title { font-size: 3.25rem; }
}

/* Short viewports (DevTools with console open, landscape phones) */
@media (max-height: 700px) {
  html[dir="rtl"] .qta-hero,
  body.qta-rtl .qta-hero {
    min-height: 100svh !important;
    justify-content: flex-start !important;
  }
  html[dir="rtl"] .qta-hero__content,
  body.qta-rtl .qta-hero__content {
    padding-top: 5.5rem !important;
    padding-bottom: 2rem !important;
  }
}
