/* Language Switcher Styles */
.lang-btn {
  /* background: transparent; */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  /* color: #fff; */
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  min-width: 120px;
}

.lang-btn:hover {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
}

.flag-icon {
  width: 25px;
  /* height: 25px; */
  object-fit: cover;
  border-radius: 2px;
}

.lang-text {
  font-weight: 500;
  color: black;
}

.lang-dropdown {
  background: #fff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  min-width: 140px;
  margin-top: 8px;
}

.lang-dropdown .dropdown-item {
  padding: 10px 16px;
  color: #333;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  border: none;
}

.lang-dropdown .dropdown-item:hover {
  background: #f8f9fa;
  color: #333;
}

.lang-dropdown .dropdown-item:active {
  background: #e9ecef;
}

/* RTL Support Styles */
body.rtl {
  direction: rtl;
  text-align: right;
}

body.rtl .language-switcher {
  margin-left: 15px;
  margin-right: 15px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

body.rtl .lang-btn {
  flex-direction: row-reverse;
}

body.rtl .dropdown-menu {
  left: auto;
  right: 0;
}

/* RTL Font Support */
body.rtl {
  font-family: 'Tajawal', 'Cairo', 'Amiri', Arial, sans-serif;
}

body.ltr {
  font-family: 'Inter', 'Poppins', 'Montserrat', Arial, sans-serif;
}

/* RTL Text Alignment */
body.rtl h1,
body.rtl h2,
body.rtl h3,
body.rtl h4,
body.rtl h5,
body.rtl h6,
body.rtl p,
body.rtl span,
body.rtl div {
  text-align: right;
}

body.ltr h1,
body.ltr h2,
body.ltr h3,
body.ltr h4,
body.ltr h5,
body.ltr h6,
body.ltr p,
body.ltr span,
body.ltr div {
  text-align: left;
}

/* RTL Navigation Adjustments */
body.rtl .main-menu__list {
  direction: rtl;
}

body.rtl .main-menu__list li {
  float: right;
}

body.rtl .sub-menu {
  right: 0;
  left: auto;
}

/* RTL Button Adjustments */
body.rtl .cus-btn,
body.rtl .cus-btn-2,
body.rtl .cus-btn-3 {
  flex-direction: row-reverse;
}

body.rtl .cus-btn i,
body.rtl .cus-btn-2 i,
body.rtl .cus-btn-3 i {
  margin-right: 8px;
  margin-left: 0;
}

/* RTL Form Adjustments */
body.rtl input,
body.rtl textarea,
body.rtl select {
  text-align: right;
  direction: rtl;
}

body.rtl .form-control::placeholder {
  text-align: right;
}

/* RTL Hero Section */
body.rtl .hero-wrapper {
  text-align: right;
}

body.rtl .btn-block {
  flex-direction: row-reverse;
  gap: 16px;
}

/* RTL About Section */
body.rtl .about-sec .ps-md-5 {
  padding-left: 0 !important;
  padding-right: 3rem !important;
}

body.rtl .about-sec .pe-md-5 {
  padding-right: 0 !important;
  padding-left: 3rem !important;
}

/* RTL Service Cards */
body.rtl .service-card,
body.rtl .team-card,
body.rtl .blog-card {
  text-align: right;
}

/* RTL Footer */
body.rtl footer {
  text-align: right;
}

body.rtl .footer-bottom-text {
  text-align: center;
}

/* RTL Mobile Menu */
body.rtl .mobile-nav__content {
  text-align: right;
}

body.rtl .mobile-nav__list li {
  text-align: right;
}

/* Fix RTL layout for the cloned mobile menu so items stack vertically */
body.rtl .mobile-nav__content .main-menu__list,
body.rtl .mobile-nav__container .main-menu__list {
  direction: rtl;
  display: block;
  display: flex;
  flex-direction: column !important;
}

body.rtl .mobile-nav__content .main-menu__list li,
body.rtl .mobile-nav__container .main-menu__list li {
  float: none !important;
  display: block;
  width: 100%;
  text-align: right;
}

body.rtl .mobile-nav__content .main-menu__list>li>a,
body.rtl .mobile-nav__container .main-menu__list>li>a {
  display: block;
  width: 100%;
}

/* Responsive RTL Adjustments */
@media (max-width: 991px) {
  .language-switcher {
    margin: 10px 0;
  }

  .lang-btn {
    min-width: 100px;
    font-size: 13px;
    padding: 6px 10px;
  }
}

@media (max-width: 767px) {
  .language-switcher {
    order: -1;
  }

  body.rtl .hero-wrapper .pe-sm-5 {
    padding-right: 0 !important;
  }

  body.rtl .about-sec .ps-md-5,
  body.rtl .about-sec .pe-md-5 {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

/* Mobile menu overrides: mobile menu has light background, so use dark text/border */
.mobile-nav__content .language-switcher .lang-btn {
  border-color: rgba(0, 0, 0, 0.15);
  color: #111;
}

.mobile-nav__content .language-switcher .lang-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.25);
  color: #111;
}

.mobile-nav__content .language-switcher .lang-text {
  color: #111;
}

.mobile-nav__content .lang-dropdown {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* Inverted variant for small-screen header (light background) */
.lang-btn--invert {
  border-color: rgba(0, 0, 0, 0.15);
  color: #111;
}

.lang-btn--invert .lang-text {
  color: #111;
}

.lang-btn--invert:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.25);
  color: #111;
}

/* Animation Adjustments for RTL */
body.rtl .wow.fadeInLeft {
  animation-name: fadeInRight;
}

body.rtl .wow.fadeInRight {
  animation-name: fadeInLeft;
}

/* Contact Information RTL Fix */
.phone-number,
a[href^="tel:"] {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: bidi-override;
}

/* Email addresses should also maintain LTR direction */
.email-address,
a[href^="mailto:"] {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: bidi-override;
}

/* For RTL layouts, keep contact info LTR but adjust container alignment */
body.rtl .phone-number,
body.rtl a[href^="tel:"],
body.rtl .email-address,
body.rtl a[href^="mailto:"] {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: bidi-override;
  display: inline-block;
}

/* Ensure parent containers don't override contact info direction */
body.rtl .info-block a[href^="tel:"],
body.rtl .info-block a[href^="mailto:"],
body.rtl .contact-info a[href^="tel:"],
body.rtl .contact-info a[href^="mailto:"],
body.rtl .footer-contact a[href^="tel:"],
body.rtl .footer-contact a[href^="mailto:"] {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: bidi-override;
}

/* Numbers and numerical content should also be LTR */
.number-content,
.numeric-value {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: bidi-override;
}

body.rtl .number-content,
body.rtl .numeric-value {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: bidi-override;
  display: inline-block;
}

/* Print Styles */
@media print {
  .language-switcher {
    display: none !important;
  }
}