/* Fix for navbar visibility issue */
.site-header.sticky-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  transition: all 0.3s ease-in-out;
}

.site-header.sticky-header.show-on-scroll {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.site-header.sticky-header.hide-menu {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

/* Override any hide on scroll behavior */
.site-header {
  display: block !important;
}

/* Fix for smooth scrolling */
html {
  scroll-behavior: smooth;
  overflow-y: auto !important;
}

body {
  overflow-x: hidden;
  overflow-y: auto !important;
}

/* WhatsApp Icon Fix */
.qlwapp-icon.qlwapp-whatsapp-icon::before {
  content: '';
  display: block;
  width: 30px;
  height: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='white' d='M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Back to top button styling */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.3s ease;
  z-index: 9998;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.back-to-top:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top .icon-arrow-up {
  font-size: 0;
  width: 0;
  height: 0;
  position: relative;
  z-index: 2;
}

.back-to-top .icon-arrow-up::before {
  content: '↑';
  font-size: 24px;
  color: white;
  font-weight: bold;
  display: block;
  line-height: 1;
}

.back-to-top svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}

.back-to-top svg circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 3;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: none;
  will-change: stroke-dashoffset;
}

/* Services Grid - Single column on small screens */
@media (max-width: 500px) {
  #servicesContainer {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 20px 15px !important;
  }

  .service-card {
    width: 100% !important;
    max-width: 100% !important;
  }

  #loadMoreContainer {
    width: 100% !important;
  }

  /* Center "Powered by" text on small screens */
  .footer-powered-by {
    margin-inline-start: 0 !important;
    margin: 0 auto !important;
    justify-content: center !important;
  }
}

/* Language Loading Screen - Preloader */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  background: #2fd4c6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-container,
.loading {
  height: 200px;
  position: relative;
  width: 200px;
  border-radius: 100%;
}

.loading-container {
  margin: 40px auto;
}

.loading {
  border: 2px solid transparent;
  border-color: transparent #ffffff transparent #ffffff;
  animation: rotate-loading 1.5s linear 0s infinite normal;
  transform-origin: 50% 50%;
}

.loading-container:hover .loading,
.loading-container .loading {
  transition: all 0.5s ease-in-out;
}

#loading-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 70px;
  transform: translate(-50%, -50%);
}

#loading-icon img {
  width: 100%;
  height: 120px;
  display: block;
  min-width: 120px;
  min-height: 120px;
  filter: brightness(0) saturate(100%) invert(100%) sepia(100%) saturate(3%)
    hue-rotate(144deg) brightness(102%) contrast(102%);
}

.loader-text {
  font-size: 18px;
  font-weight: 600;
  margin: 20px 0 0 0;
  letter-spacing: 1px;
  color: white;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes rotate-loading {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Language Toggle Button */
.lang-toggle {
  transition: all 0.3s ease;
}

.lang-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  border-color: #2fd4c6 !important;
}

.lang-toggle img {
  object-fit: cover;
  display: block;
}

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

/* Removed flex-direction: row-reverse because JavaScript already handles menu reversal */
/* body.rtl .navbar-nav,
body.rtl .elementskit-navbar-nav {
  flex-direction: row-reverse;
} */

body.rtl .text-left {
  text-align: right !important;
}

body.rtl .text-right {
  text-align: left !important;
}

/* RTL Icon Fixes */
body.rtl .fa-arrow-right:before {
  content: '\f060'; /* arrow-left */
}

body.rtl .fa-arrow-left:before {
  content: '\f061'; /* arrow-right */
}

body.rtl .fa-chevron-right:before {
  content: '\f053'; /* chevron-left */
}

body.rtl .fa-chevron-left:before {
  content: '\f054'; /* chevron-right */
}

/* RTL Margin and Padding Adjustments */
body.rtl [style*='margin-left'] {
  margin-right: var(--margin-value) !important;
  margin-left: auto !important;
}

body.rtl [style*='margin-right'] {
  margin-left: var(--margin-value) !important;
  margin-right: auto !important;
}

/* RTL Button Icon Spacing */
body.rtl button i,
body.rtl a i {
  margin-right: 0;
  margin-left: 8px;
}

body.ltr button i,
body.ltr a i {
  margin-right: 8px;
  margin-left: 0;
}

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

/* RTL Lists */
body.rtl ul,
body.rtl ol {
  padding-right: 20px;
  padding-left: 0;
}

/* Mobile Menu - Hide desktop auth buttons on mobile/tablet */
@media (max-width: 1024px) {
  /* Hide the desktop auth buttons container on mobile */
  .elementor-element.e-con-full.e-flex.e-con.e-child[style*='margin-left: auto'] {
    display: none !important;
  }

  /* Alternative selector if the above doesn't work */
  .auth-buttons,
  .user-info-nav {
    display: none !important;
  }

  /* Make sure menu items are visible WHEN MENU IS OPEN */
  #menu-mobile-menu li {
    display: block;
    visibility: visible;
    opacity: 1;
  }

  /* Ensure mobile menu auth buttons are visible WHEN MENU IS OPEN */
  .btn-auth-nav-mobile,
  .btn-booking-nav-mobile,
  .lang-toggle {
    display: flex;
    visibility: visible;
    opacity: 1;
  }

  /* Make sure the mobile menu container has proper styling when opened */
  .elementskit-menu-container.elementskit-menu-offcanvas-elements {
    min-height: 100vh;
    width: 320px;
    background: white;
  }
}

body.rtl .keydesign-label .t-a-12 {
  inset-inline-end: 0 !important;
}
