/* ===== TEXT ALIGNMENT FIXES ===== */
[dir="rtl"] .text-left {
  text-align: right !important;
}

[dir="rtl"] .text-center {
  text-align: center !important;
}

[dir="rtl"] .text-right {
  text-align: left !important;
}

/* Hero section text alignment */
[dir="rtl"] .hero-content h1,
[dir="rtl"] .hero-content p {
  text-align: right !important;
}

[dir="rtl"] #CompanyOverview .label-title-edit[data-i18n="company.overview"] {
  text-align: right !important;
}

/* Company overview text alignment */
[dir="rtl"] #companyOverviewP .text-left {
  text-align: right !important;
}

[dir="rtl"] #companyOverviewP h2,
[dir="rtl"] #companyOverviewP p {
  text-align: right !important;
  font-family: "Tajawal", sans-serif !important;
}

/* Our Brands text alignment */
[dir="rtl"] .brand-content.text-left {
  text-align: right !important;
}

/* Values section */
[dir="rtl"] .industry-card {
  text-align: center !important;
}

[dir="rtl"] .industry-card h3,
[dir="rtl"] .industry-card p {
  text-align: center !important;
}

[dir="rtl"] .industry-card {
  text-align: right !important;
}

[dir="rtl"] #valuessection .industry-card p {
  text-align: right !important;
}

[dir="rtl"] .industry-card h3,
[dir="rtl"] .industry-card p {
  text-align: right !important;
}

/* ===== VISION & MISSION RTL FIXES ===== */

/* Remove the mirror flip - we don't need it anymore with absolute positioning */

/* Desktop RTL adjustments */
@media (min-width: 992px) {
  [dir="rtl"] #VisionMission .container {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 6rem !important;
    flex-direction: row-reverse !important;
    max-width: 100% !important;
    width: 100% !important;
    justify-content: flex-end;
  }

  /* Position image to left edge in RTL */
  [dir="rtl"] .desktop-background-image {
    right: auto;
    left: 0;
    order: 1; /* Image comes first (left side) */
  }

  /* Mirror the image horizontally for RTL */
  [dir="rtl"] .desktop-background-image img {
    object-position: right center;
    transform: scaleX(-1); /* Only flip the image itself */
  }

  /* Text content positioning for RTL - moves to right side */
  [dir="rtl"] .vision-text-content {
    padding-right: 0;
    padding-left: 0;
    margin-left: auto;
    margin-right: 3.6rem;
    order: 2; /* Text comes second (right side) */
  }

  /* Text alignment for RTL */
  [dir="rtl"] #VisionMission .vision-title,
  [dir="rtl"] #VisionMission .vision-text {
    text-align: right !important;
  }

  [dir="rtl"] #VisionMission .vision-content {
    margin-left: 0 !important;
  }
}

/* Mobile RTL adjustments */

/* Title styling for RTL */
[dir="rtl"] .vision-title {
  text-align: right !important;
  direction: rtl;
  line-height: 1.1 !important;
}

[dir="rtl"] .vision-title br {
  display: none;
}

[dir="rtl"] .forOUR.label-title-edit {
  text-align: right !important;
  display: block;
  margin-bottom: 0.5rem !important;
  font-size: 1rem !important;
}

[dir="rtl"] #VisionMission .vision-title #noBold {
  font-family: "Tajawal", sans-serif !important;
  font-weight: 700 !important;
  text-align: right !important;
  display: block;
  padding-left: 5rem !important;
}

/* ===== COMPANY OVERVIEW RTL ===== */
@media (min-width: 992px) {
  [dir="rtl"] #CompanyOverview > .container {
    margin-right: 8.5rem !important;
  }
}

@media (min-width: 1601px) {
  [dir="rtl"] #CompanyOverview .container {
    max-width: 2000px !important;
  }
}

@media (max-width: 992px) {
  [dir="rtl"] #companyOverviewP .text-left {
    padding-right: 1rem !important;
  }
}

[dir="rtl"] #CompanyOverview .label-title-edit {
  font-family: "Tajawal", sans-serif !important;
  font-size: 1rem !important;
}

[dir="rtl"] #CompanyOverview .h3.font-alt {
  font-family: "Tajawal", sans-serif !important;
}

/* ===== FIX OUR BRANDS TRANSLATION IN MOBILE ===== */
@media (max-width: 991px) {
  /* Ensure text elements in Our Brands section are visible and translatable */
  [dir="rtl"] .brand-content .text-line,
  [dir="rtl"] .brand-content h1,
  [dir="rtl"] .brand-content h3 {
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Override any animation transforms that might break RTL */
  [dir="rtl"] .animbounceInLeft,
  [dir="rtl"] .animbounceInRight {
    animation: none !important;
    transform: none !important;
  }

  /* Ensure proper RTL text alignment in Our Brands */
  [dir="rtl"] .brand-content.text-left {
    text-align: right !important;
  }

  [dir="rtl"] .brand-content h1,
  [dir="rtl"] .brand-content h3 {
    direction: rtl;
  }
  #VisionMission .vision-title {
    margin-bottom: 6rem !important;
  }
  [dir="rtl"] #VisionMission .vision-title {
    margin-bottom: 4rem !important;
  }
}

/* RTL override: show translated HTML spans on mobile & hide hard-coded CSS pseudo-elements */
@media (max-width: 768px) {
  [dir="rtl"] .brand-frame:first-child .brand-content .text-line {
    display: block !important;
  }
  [dir="rtl"] .brand-frame:first-child .brand-content h1::before,
  [dir="rtl"] .brand-frame:first-child .brand-content h1::after,
  [dir="rtl"] .brand-frame:first-child .brand-content h3::before {
    content: none !important;
    display: none !important;
  }
}

/* ===== FOOTER RTL ===== */
@media (max-width: 991px) {
  [dir="rtl"] .footer .text-sm-left {
    text-align: right !important;
  }
  [dir="rtl"] .footer .text-sm-right {
    text-align: right !important;
  }
  [dir="rtl"] .footer .text-sm-right p {
    text-align: right !important;
  }
}

/* ===== BANNER RTL ===== */
[dir="rtl"] #banner-text {
  font-size: 1rem !important;
}

/* ===== FONT WEIGHTS ===== */
@media (min-width: 992px) {
  #valuessection .industry-card p,
  #CompanyOverview p,
  #VisionMission .vision-text {
    font-weight: 400 !important;
  }
}

/* ===== LABEL STYLING ===== */
[dir="rtl"] .label-title-edit {
  font-size: 1rem !important;
}

[dir="rtl"] .forOUR {
  font-size: 1rem !important;
}

/* ===== MORE ABOUT TEXT ===== */
[dir="rtl"] .more-about-text {
  font-size: 1.1rem;
}

/* ===== FORCE LTR FOR PHONE NUMBERS ===== */
/* Force LTR for phone numbers even in RTL */
.ltr-text {
  direction: ltr !important;
  display: inline-block;
}
