/* AJAX Language Switcher - pill UI */
#contact-btns-wrapper.alsfe-wrapper,
#contact-btns-wrapper .custom-language-switcher,
.alsfe-wrapper .custom-language-switcher {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: 187.86px;
  height: 51px;
  font-family: "Inter", "Gilroy", Arial, sans-serif;
  z-index: 99999;
}

#contact-btns-wrapper .custom-lang-selected,
.alsfe-wrapper .custom-lang-selected {
  width: 187.86px;
  height: 51px;
  padding: 0 74px 0 26px;
  background: transparent;
  border: 1px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

#contact-btns-wrapper .custom-lang-selected:hover,
#contact-btns-wrapper .custom-lang-selected:focus,
.alsfe-wrapper .custom-lang-selected:hover,
.alsfe-wrapper .custom-lang-selected:focus {
  background: transparent;
  color: #ffffff;
  border-color: #ffffff;
}

#contact-btns-wrapper .custom-lang-text,
.alsfe-wrapper .custom-lang-text {
  display: inline-block;
  color: #ffffff;
  white-space: nowrap;
}

#contact-btns-wrapper .custom-lang-flag-wrap,
.alsfe-wrapper .custom-lang-flag-wrap {
  width: 64px;
  height: 45px;
  background: #ffffff;
  border-radius: 999px;
  position: absolute;
  right: 4px;
  top: 3px;
  z-index: 1;
}

#contact-btns-wrapper .custom-lang-flag,
.alsfe-wrapper .custom-lang-flag {
  width: 48px;
  height: 35px;
  min-width: 39px;
  padding: 2px;
  margin: 0;
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  right: 8px;
  top: 5px;
  z-index: 2;
}

#contact-btns-wrapper .custom-lang-arrow,
.alsfe-wrapper .custom-lang-arrow {
  width: 11px;
  height: 11px;
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  transform: rotate(45deg);
  position: absolute;
  right: 78px;
  top: 17px;
  z-index: 3;
  pointer-events: none;
}

#contact-btns-wrapper .custom-lang-options,
.alsfe-wrapper .custom-lang-options {
  display: none;
  width: 187.86px;
  height: auto;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 999999;
}

#contact-btns-wrapper .custom-language-switcher.is-open .custom-lang-options,
.alsfe-wrapper .custom-language-switcher.is-open .custom-lang-options {
  display: block;
}

#contact-btns-wrapper .custom-lang-options button,
.alsfe-wrapper .custom-lang-options button {
  width: 100%;
  border: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: #111111;
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  background: #ffffff;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}

#contact-btns-wrapper .custom-lang-options button img,
.alsfe-wrapper .custom-lang-options button img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

#contact-btns-wrapper .custom-lang-options button:hover,
#contact-btns-wrapper .custom-lang-options button.is-active,
.alsfe-wrapper .custom-lang-options button:hover,
.alsfe-wrapper .custom-lang-options button.is-active {
  background: #f2f5ff;
  color: #145dd1;
}

html.alsfe-loading body {
  cursor: wait;
}

html.alsfe-loading [data-elementor-type="wp-page"],
html.alsfe-loading main,
html.alsfe-loading #content,
html.alsfe-loading .site-main {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Arabic keeps the same LTR layout; only text/content changes. */
/* Mobile */
@media (max-width: 767px) {
  #contact-btns-wrapper.alsfe-wrapper,
  #contact-btns-wrapper .custom-language-switcher,
  .alsfe-wrapper .custom-language-switcher {
    width: 130px !important;
    height: 46px !important;
  }

  #contact-btns-wrapper .custom-lang-selected,
  .alsfe-wrapper .custom-lang-selected {
    width: 130px !important;
    height: 46px !important;
    padding-left: 10px !important;
    padding-right: 54px !important;
    font-size: 13px !important;
  }

  #contact-btns-wrapper .custom-lang-flag-wrap,
  .alsfe-wrapper .custom-lang-flag-wrap {
    display: block !important;
    width: 46px !important;
    height: 46px !important;
    background: transparent !important;
    right: 0 !important;
    top: 0 !important;
    border-radius: 0 !important;
  }

  #contact-btns-wrapper .custom-lang-flag,
  .alsfe-wrapper .custom-lang-flag {
    width: 30px !important;
    height: 30px !important;
    right: 6px !important;
    top: 8px !important;
    padding: 4px !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    object-fit: cover !important;
  }

  #contact-btns-wrapper .custom-lang-arrow,
  .alsfe-wrapper .custom-lang-arrow {
    width: 9px !important;
    height: 9px !important;
    right: 45% !important;
    top: 16px !important;
  }

  #contact-btns-wrapper .custom-lang-options,
  .alsfe-wrapper .custom-lang-options {
    width: 160px !important;
  }
}

/* Full-screen loader shown while AJAX language content is loading */
.alsfe-loader-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  z-index: 2147483000;
}

html.alsfe-loading .alsfe-loader-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.alsfe-loader-card {
  width: min(280px, 92vw);
  min-height: 170px;
  padding: 28px 24px 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.alsfe-loader-ring {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 4px solid rgba(4, 57, 169, 0.16);
  border-top-color: #0439a9;
  animation: alsfeSpin 0.8s linear infinite;
}

.alsfe-loader-flag-wrap {
  width: 34px;
  height: 34px;
  padding: 4px;
  margin-top: -46px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}

.alsfe-loader-flag {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.alsfe-loader-title {
  color: #000c45;
  font-family: "Inter", "Gilroy", Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
}

.alsfe-loader-text {
  color: rgba(0, 12, 69, 0.62);
  font-family: "Inter", "Gilroy", Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

@keyframes alsfeSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .alsfe-loader-ring {
    animation: none;
  }
}

/* Translation unavailable toast */
.alsfe-notice {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
  font-family: "Inter", "Gilroy", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
  z-index: 2147483001;
}

.alsfe-notice.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* Country & Phone Field Contact Form 7 re-init safety after AJAX swaps.
   The plugin uses intl-tel-input v12 classes: .intl-tel-input, .flag-container,
   .selected-flag, .iti-flag, .country-list. */
.partner-cf7-form .intl-tel-input {
  width: 100%;
  display: block;
}

.partner-cf7-form .intl-tel-input input.partner-cf7-phone,
.partner-cf7-form .intl-tel-input input.wpcf7-phonetext,
.partner-cf7-form .intl-tel-input input[name^="phonetext"] {
  width: 100%;
  padding-left: 70px !important;
}

.partner-cf7-form .intl-tel-input .flag-container {
  z-index: 20;
}

.partner-cf7-form .intl-tel-input .selected-flag {
  background: transparent !important;
}

.partner-cf7-form .intl-tel-input .country-list {
  z-index: 2147482000;
}

/* Hide only true duplicate generated wrappers, not the active one. */
.partner-cf7-form .partner-cf7-field .intl-tel-input ~ .intl-tel-input,
.partner-cf7-form .partner-cf7-field .flag-container ~ .flag-container {
  display: none !important;
}



/* Prevent Elementor layout flash on direct Arabic/French page load */
body.alsfe-preload-page [data-elementor-type="wp-page"] {
  opacity: 0 !important;
  visibility: hidden !important;
}

body.alsfe-preload-page::after {
  content: "";
  position: fixed;
  width: 34px;
  height: 34px;
  left: 50%;
  top: 50%;
  margin-left: -17px;
  margin-top: -17px;
  border: 3px solid rgba(4, 57, 169, 0.18);
  border-top-color: #145dd1;
  border-radius: 50%;
  animation: alsfe-spin 0.75s linear infinite;
  z-index: 9999999;
  pointer-events: none;
}

/* Extra hard anti-FOUC guard; paired with critical head CSS. */
html.alsfe-boot-hide body [data-elementor-type="wp-page"],
html.alsfe-boot-hide body main,
html.alsfe-boot-hide body #content,
html.alsfe-boot-hide body .site-main {
  opacity: 0 !important;
  visibility: hidden !important;
}
