/* ACE Language Switcher */

.ace-lang-switch {
  --ace-navy: #0a1f40;
  --ace-gold: #c9a227;
  --ace-gold-2: #e8b84b;
  --ace-muted: #94a3b8;
  --ace-white: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  border-radius: 999px;
  background: rgba(10, 31, 64, 0.92);
  border: 1px solid rgba(201, 162, 39, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  font-family: 'Cairo', 'Inter', system-ui, sans-serif;
  line-height: 1;
}

.ace-lang-switch--floating {
  position: fixed;
  top: 50%;
  inset-inline-end: 16px;
  transform: translateY(-50%);
  flex-direction: column;
  border-radius: 18px;
  padding: 6px;
  gap: 4px;
}

.ace-lang-switch--inline {
  vertical-align: middle;
}

.ace-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.ace-lang-switch--floating .ace-lang-btn {
  border-radius: 12px;
  justify-content: center;
  min-width: 52px;
  padding: 10px 12px;
}

.ace-lang-btn:hover {
  color: var(--ace-white);
  background: rgba(255, 255, 255, 0.08);
}

.ace-lang-btn.is-active {
  color: var(--ace-navy);
  background: linear-gradient(135deg, var(--ace-gold), var(--ace-gold-2));
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.35);
}

.ace-lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ace-lang-btn.is-active .ace-lang-flag {
  background: rgba(10, 31, 64, 0.12);
}

.ace-lang-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
}

.ace-lang-switch--floating .ace-lang-divider {
  width: 60%;
  height: 1px;
  margin-inline: auto;
}

.ace-lang-switch--floating .ace-lang-label {
  display: none;
}

/* Hide opposite-language Elementor HTML blocks if both exist on same page */
body.ace-lang-ar [data-ace-lang="en"],
body.ace-lang-en [data-ace-lang="ar"] {
  display: none !important;
}

/* Soft LTR nudge for English body when theme is RTL-based */
body.ace-lang-en.ace-ltr {
  direction: ltr;
}

body.ace-lang-ar.ace-rtl {
  direction: rtl;
}

/* Hide Minimog cart countdown on English (mixed/broken text + chatbot pollution) */
body.ace-lang-en .cart-countdown-message {
  display: none !important;
}

@media (max-width: 768px) {
  /* Sit above #page-mobile-tabs (~64px) and above the contact stack */
  .ace-lang-switch--floating {
    top: auto;
    bottom: 210px;
    transform: none;
    inset-inline-end: 12px;
    z-index: 99990;
  }

  .ace-lang-switch--inline .ace-lang-label {
    display: none;
  }
}

/* Floating WhatsApp + Call (Call under WhatsApp) */
.ace-float-contact {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ace-float-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ace-float-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.ace-float-btn svg {
  width: 28px;
  height: 28px;
}

.ace-float-btn--wa {
  background: #25d366;
}

.ace-float-btn--call {
  background: #0a1f40;
  border: 2px solid #c9a227;
}

.ace-float-btn--call svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  /* Clear #page-mobile-tabs so Call/WA stay tappable */
  .ace-float-contact {
    left: 14px;
    bottom: 78px;
    z-index: 100001;
  }

  .ace-float-btn {
    width: 52px;
    height: 52px;
  }
}
