/* ========================================
   WHATSAPP BUTTON POSITION FIX
   إصلاح موضع زر الواتساب للأجهزة المحمولة فقط
   ======================================== */

/* قاعدة عامة لضمان ظهور زر الواتساب فوق جميع العناصر */
.floating-whatsapp {
  z-index: 500 !important;
  position: fixed !important;
}

/* التأكد من عدم تأثير التعديلات على الكمبيوتر */
@media (min-width: 769px) {
  .floating-whatsapp {
    bottom: clamp(1rem, 3vw, 2rem) !important;
    right: clamp(1rem, 3vw, 2rem) !important;
    z-index: 500 !important;
    position: fixed !important;
  }
}

/* إصلاح شامل للأجهزة المحمولة فقط (ليس الكمبيوتر) */
@media (max-width: 768px) {
  .floating-whatsapp {
    bottom: 8rem !important;
    position: fixed !important;
    z-index: 500 !important;
    /* الحفاظ على الشكل الأصلي مثل الكمبيوتر */
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.85rem !important;
    padding: 1rem 1.55rem !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    font-size: 1.02rem !important;
    width: auto !important;
    height: auto !important;
  }
}

/* إصلاح للهواتف الذكية - الحفاظ على الشكل الكامل */
@media (max-width: 768px) {
  .floating-whatsapp {
    bottom: 8rem !important;
    right: 1rem !important;
    /* الحفاظ على النص والشكل الأصلي */
    padding: 0.8rem 1.2rem !important;
    font-size: 0.9rem !important;
    gap: 0.6rem !important;
  }
  
  .floating-whatsapp__icon {
    font-size: 1.1rem !important;
  }
}

/* إصلاح للهواتف الصغيرة - تقليل الحجم قليلاً مع الحفاظ على الشكل */
@media (max-width: 480px) {
  .floating-whatsapp {
    bottom: 8rem !important;
    right: 0.75rem !important;
    padding: 0.7rem 1rem !important;
    font-size: 0.85rem !important;
    gap: 0.5rem !important;
  }
}

/* إصلاح للهواتف الصغيرة جداً */
@media (max-width: 374px) {
  .floating-whatsapp {
    bottom: 8rem !important;
    bottom: calc(8rem + env(safe-area-inset-bottom, 0)) !important;
    right: 0.5rem !important;
    padding: 0.6rem 0.8rem !important;
    font-size: 0.8rem !important;
    gap: 0.4rem !important;
  }
}

/* إصلاح للأجهزة اللمسية الصغيرة فقط */
@media (hover: none) and (pointer: coarse) and (max-width: 768px) {
  .floating-whatsapp {
    bottom: 8rem !important;
  }
}

/* إصلاح للأجهزة ذات الحواف المنحنية */
@supports (padding: max(0px)) {
  @media (max-width: 768px) {
    .floating-whatsapp {
      bottom: max(8rem, calc(8rem + env(safe-area-inset-bottom))) !important;
      right: max(1rem, env(safe-area-inset-right)) !important;
    }
  }
}

/* إصلاح إضافي لضمان التطبيق */
.floating-whatsapp[style*="bottom"] {
  bottom: 8rem !important;
}

/* إصلاح للوضع الأفقي على الموبايل */
@media (max-width: 768px) and (orientation: landscape) {
  .floating-whatsapp {
    bottom: 6rem !important;
  }
}

/* ضمان عرض النص في جميع الأحجام */
@media (max-width: 1023px) {
  .floating-whatsapp span {
    display: inline !important;
    white-space: nowrap !important;
  }
  
  .floating-whatsapp .floating-whatsapp__icon {
    display: inline !important;
  }
}
