/* Custom fixes for Aid Section */
/* Enhanced Icon Styling with Animation */
.feature-item .lab-thumb {
  width: 140px;
  height: 140px;
  margin: 0 auto 30px;
  /* Centered with bottom space */
  background: linear-gradient(135deg, #eaf6ff 0%, #f7fbff 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: all 0.4s ease;
  box-shadow: 0 10px 20px rgba(0, 113, 239, 0.05);
}

/* Decorative pulsing circle behind */
.feature-item .lab-thumb::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: rgba(0, 113, 239, 0.08);
  border-radius: 50%;
  z-index: -1;
  animation: pulse-ring 3s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Rotating dashed ring for technical feel */
.feature-item .lab-thumb::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 113, 239, 0.2);
  animation: spin-dashed 15s linear infinite;
}

.feature-item .lab-thumb img {
  width: 65px;
  /* Slightly larger within the circle */
  height: auto;
  display: block;
  margin: 0;
  /* Centered by flexbox */
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.05));
}

/* Hover Effects */
.feature-item:hover .lab-thumb {
  background: #fff;
  box-shadow: 0 15px 35px rgba(0, 113, 239, 0.2);
  transform: translateY(-5px);
}

.feature-item:hover .lab-thumb::after {
  border-color: rgba(0, 113, 239, 0.4);
  animation-duration: 5s;
  /* Speed up on hover */
}

.feature-item:hover .lab-thumb img {
  transform: scale(1.15) rotate(5deg);
}

/* Keyframes */
@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.6;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
  }
}

@keyframes spin-dashed {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@media (min-width: 992px) {
  .aid-section .section-wrapper .aid-slider.medical-top .lab-item-inner {
    display: flex;
    flex-direction: row-reverse;
    min-height: 400px;
    /* Ensure minimum height */
  }

  .aid-section .section-wrapper .aid-slider.medical-top .lab-content {
    width: 60%;
    padding: 30px;
  }

  .aid-section .section-wrapper .aid-slider.medical-top .lab-thumb {
    width: 40%;
    position: relative;
    /* Container for absolute image */
  }

  .aid-section .section-wrapper .aid-slider.medical-top .lab-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.aid-section .section-wrapper .aid-slider.medical-thumbs .swiper-slide {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.aid-section .section-wrapper .aid-slider.medical-thumbs .swiper-slide-thumb-active {
  opacity: 1;
}

.aid-section .section-wrapper .aid-slider.medical-thumbs .lab-item {
  color: #333;
}

.aid-section .section-wrapper .aid-slider.medical-thumbs .swiper-slide-thumb-active .lab-item h6 {
  color: #0071ef !important;
}

/* Feature Section Enhancements */
.feature-section .feature-item {
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  /* Soft shadow */
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.02);
  overflow: hidden;
  height: 100%;
}

.feature-section .feature-item:hover {
  transform: translateY(-7px);
  box-shadow: 0 15px 40px rgba(0, 113, 239, 0.15);
  /* Blue-tinted shadow on hover */
  border-color: rgba(0, 113, 239, 0.1);
}

.feature-section .feature-item .lab-inner {
  padding: 25px 8px 15px;
  /* Minimized side padding for max content width, reduced bottom padding */
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.feature-section .feature-item h4 {
  margin: 15px 0 10px;
  font-size: 19px;
  font-weight: 700;
  color: #222;
}

.feature-section .feature-list {
  text-align: right;
  display: block;
  padding: 0 5px;
  margin: 0;
  list-style: none;
  /* Remove default bullets */
}

.feature-section .feature-list li {
  font-size: 15px;
  color: #555;
  margin-bottom: 8px;
  position: relative;
  padding-right: 25px;
  /* Space for the checkmark */
  text-align: justify;
  /* Justify alignment */
  line-height: 1.6;
}

/* Custom Checkmark Icon */
.feature-section .feature-list li::before {
  content: '\eed8';
  /* Icofont check mark code */
  font-family: 'IcoFont';
  position: absolute;
  right: 0;
  top: 2px;
  color: #0071ef;
  /* Primary blue */
  font-weight: bold;
  font-size: 16px;
}

/* Read More Button Styling */
.read-more-btn {
  display: inline-block;
  margin-top: auto;
  padding: 8px 20px;
  color: #0071ef;
  border: 2px solid #0071ef;
  border-radius: 50px;
  /* Pill shape */
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s ease;
  text-decoration: none;
  align-self: center;
}

.read-more-btn:hover {
  background-color: #0071ef;
  color: #fff;
  box-shadow: 0 5px 15px rgba(0, 113, 239, 0.3);
  text-decoration: none;
}

.read-more-btn i {
  margin-right: 5px;
  transition: transform 0.3s ease;
}

.read-more-btn:hover i {
  transform: translateX(-3px);
  /* Move arrow slightly left on hover (RTL) */
}

/* =========================================
   MOBILE & TABLET RESPONSIVENESS FIXES
   ========================================= */

/* 1. Prevent Horizontal Scrolling globally */
html,
body {
  overflow-x: hidden;
  width: 100%;
}

/* 2. Mobile/Tablet specific adjustments (Max width 991px) */
@media (max-width: 991px) {

  /* Adjust container padding to prevent edge sticking */
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Fix Feature Items on Tablets/Mobile */
  .feature-section .section-content .row>div {
    margin-bottom: 30px !important;
  }

  .feature-section .feature-item {
    margin-bottom: 0;
  }

  .feature-section .feature-item .lab-inner {
    padding: 20px 15px;
    /* More padding for mobile touch */
  }

  /* Typography Checks */
  h1,
  .banner-content h1 {
    font-size: 28px !important;
    /* Smaller H1 for mobile */
    line-height: 1.3 !important;
  }

  h2,
  .section-header h2 {
    font-size: 24px !important;
  }

  /* Banner Padding */
  .banner-section {
    padding: 60px 0;
    /* Reduce massive top/bottom padding */
  }

  .banner-content {
    text-align: center;
  }

  /* Aid Section / Medical Slider Mobile Fixes */
  .aid-section .section-wrapper .aid-slider.medical-top .lab-item-inner {
    flex-direction: column;
    /* Stack vertically on mobile */
    display: block;
    /* Fallback */
  }

  .aid-section .section-wrapper .aid-slider.medical-top .lab-thumb {
    width: 100%;
    height: 250px;
    /* Fixed height for image area */
    position: relative;
  }

  .aid-section .section-wrapper .aid-slider.medical-top .lab-content {
    width: 100%;
    padding: 20px 15px;
    /* Adjust padding */
  }

  /* Ensure images in sliders don't overflow */
  .swiper-slide img {
    max-width: 100%;
    height: auto;
  }
}

/* 3. Small Mobile Specifics (Max width 575px) */
@media (max-width: 575px) {

  /* Mobile Menu Logo sizing if needed */
  .mobile-menu .logo img {
    max-width: 120px;
  }

  /* Department/Services Grid Fixes if using flex */
  /* Department/Services Grid Fixes if using flex */
  .department-section.style-2 .section-wrapper .lab-item {
    width: 33.33% !important;
    margin-bottom: 10px;
    padding: 0 2px;
  }

  .department-section.style-2 .section-wrapper .lab-item .lab-item-inner {
    padding: 10px 0 !important;
    margin: 2px !important;
    height: 100%;
    /* Ensure equal height */
  }

  .department-section.style-2 .section-wrapper .lab-item .lab-item-inner img {
    margin: 5px 0 0 0 !important;
    width: 40px;
    /* Smaller icon for 3-column grid */
  }

  .department-section.style-2 .section-wrapper .lab-item .lab-item-inner h4 {
    margin-bottom: 5px !important;
    font-size: 13px !important;
    /* Smaller font for 3-column grid */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
  }

  .department-section.style-2 .section-wrapper .lab-item .lab-item-inner h4 {
    margin-bottom: 5px !important;
    /* Small space between title and icon */
    font-size: 16px;
  }

  /* Footer Input Fixes for very small screens */
  .footer-section.style-1 .footer-top .footer-about .bottom .news-input {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-section.style-1 .footer-top .footer-about .bottom .news-input input {
    margin-bottom: 10px;
  }

  .whatsapp-btn {
    width: 100%;
  }
}

/* 4. RTL Specific Mobile Adjustments */
@media (max-width: 991px) {

  /* Reverse margins where necessary if bootstrap doesn't handle it */
  .mr-0,
  .mr-1,
  .mr-2,
  .mr-3,
  .mr-4,
  .mr-5 {
    margin-right: 0 !important;
  }

  /* Ensure text alignment is natural on mobile unless centered */
  .text-right-mobile {
    text-align: right !important;
  }

  .text-center-mobile {
    text-align: center !important;
  }
}

/* =========================================
   MOBILE MENU & SIDEBAR REDESIGN
   ========================================= */

/* 1. Navbar Layout (Logo Right, Menu Left) */
.mobile-menu-wrapper {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  direction: ltr !important;
  /* Force LTR for layout predictability */
  padding: 5px 15px !important;
  /* Reduced padding */
  background-color: #ffffff !important;
  border-bottom: 1px solid #f0f0f0;
  width: 100% !important;
}

/* Force Logo to the Right (Order 2 in LTR) */
.mobile-menu-wrapper .logo {
  order: 2 !important;
  display: block !important;
  margin-left: 0 !important;
  /* Remove left margin since we are spacing between */
}

/* Force Toggle to the Left (Order 1 in LTR) */
.mobile-menu-wrapper .open-menu {
  order: 1 !important;
  cursor: pointer;
  font-size: 26px;
  color: #0071ef !important;
  background-color: #f8f9fa !important;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.3s ease;
  border: 1px solid #eee !important;
  margin: 0 !important;
  position: static !important;
  float: none !important;
  right: auto !important;
  top: auto !important;
}

.mobile-menu .open-menu:hover {
  background-color: #0071ef !important;
  color: #ffffff !important;
}

/* 2. Sidebar Styling (Modern & Premium) */
.hc-offcanvas-nav .nav-container {
  background-color: rgba(255, 255, 255, 0.95) !important;
  /* Glassy opaque white */
  backdrop-filter: blur(10px) !important;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1) !important;
}

.hc-offcanvas-nav .nav-wrapper,
.hc-offcanvas-nav nav,
.hc-offcanvas-nav ul,
.hc-offcanvas-nav li,
.hc-offcanvas-nav .nav-content {
  background-color: transparent !important;
}

.hc-offcanvas-nav .nav-header {
  background: linear-gradient(135deg, #0071ef 0%, #0056b3 100%) !important;
  padding: 30px 20px !important;
  border-bottom: none !important;
  box-shadow: 0 4px 15px rgba(0, 113, 239, 0.2);
  min-height: 100px !important;
  display: flex;
  align-items: center;
}

.hc-offcanvas-nav .nav-header .nav-title {
  color: #ffffff !important;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
}

/* Menu Items Styling - Modern Cards */
.hc-offcanvas-nav li.nav-item {
  margin: 5px 10px;
}

.hc-offcanvas-nav li.nav-item a {
  background-color: #ffffff !important;
  color: #333333 !important;
  border-radius: 10px;
  border: 1px solid #f5f5f5 !important;
  padding: 14px 20px !important;
  font-weight: 600;
  font-size: 16px;
  display: flex !important;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  direction: rtl;
  /* Arabic text alignment */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.hc-offcanvas-nav li.nav-item a:hover {
  background-color: #f0f7ff !important;
  color: #0071ef !important;
  border-color: #dbeafe !important;
  transform: translateX(-5px);
  /* Slide left slightly on hover */
  box-shadow: 0 4px 10px rgba(0, 113, 239, 0.15);
}

/* Sidebar Icons Styling */
.hc-offcanvas-nav li.nav-item a i {
  margin-left: 15px !important;
  font-size: 22px;
  color: #0071ef !important;
  width: 30px;
  text-align: center;
  transition: transform 0.3s ease;
}

.hc-offcanvas-nav li.nav-item a:hover i {
  transform: scale(1.1);
}

/* Hide Close Button */
.hc-offcanvas-nav .nav-close-button {
  display: none !important;
}

/* 3. Logo Enhancement */
.mobile-menu .logo img {
  max-height: 100px !important;
  /* Increased max-height allowance */
  width: 200px !important;
  /* Force wider display to make it appear bigger */
  height: auto !important;
  /* Maintain aspect ratio */
  max-width: 65vw !important;
  /* Safety cap to prevent overlap with menu */
  display: block !important;
}

/* Active Page Style */
.hc-offcanvas-nav li.nav-item.active-page a {
  background-color: #0071ef !important;
  color: #ffffff !important;
  border-color: #0071ef !important;
  box-shadow: 0 4px 10px rgba(0, 113, 239, 0.3) !important;
}

.hc-offcanvas-nav li.nav-item.active-page a i {
  color: #ffffff !important;
}

/* 4. Menu Custom Header & Footer */
.hc-offcanvas-nav .menu-header-text {
  padding: 15px 5px 5px !important;
  /* Reduced horizontal padding */
  text-align: right;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 5px;
}

.hc-offcanvas-nav .clinic-name {
  color: #0071ef !important;
  font-weight: 800;
  font-size: clamp(10px, 3.5vw, 13px) !important;
  display: block;
  line-height: 1.2;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}

.hc-offcanvas-nav .copyright-nav {
  margin-top: 5px !important;
  border-top: 1px solid #f0f0f0 !important;
  /* Matches header line */
  padding: 8px 5px !important;
  background-color: #f9f9f9 !important;
}

.hc-offcanvas-nav .copyright-item {
  text-align: center !important;
  width: 100%;
  padding: 8px 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: relative;
  /* For the line if needed, but nav border is better */
}

.hc-offcanvas-nav .copyright-item p {
  display: none !important;
}

.hc-offcanvas-nav .copyright-item a {
  color: #555 !important;
  text-decoration: none !important;
  font-weight: bold;
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  padding: 4px 10px !important;
  border: 1px solid #ddd !important;
  background: #fff !important;
  border-radius: 4px;
  margin: 0 !important;
  font-size: 9px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  width: auto !important;
  max-width: 95%;
  /* Removed direction: rtl to let HTML handle bidi or forced lrm */
}

.mobile-menu .logo a {
  display: block !important;
}