/* Only apply fixed positioning when scrolled to avoid gaps at the top */
.elementor-location-header.header-fixed,
header.site-header.header-fixed {
  position: fixed !important;
  top: 0 !important; /* Force direct attachment to the top of the viewport */
  left: 0 !important;
  margin-top: 0 !important; /* Force clear any native margins causing gaps */
  width: 100% !important;
  z-index: 9999 !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease !important;
  will-change: transform;
}

/* 
 * Removed body.admin-bar offsets.
 * Since the admin bar scrolls away or behaves differently depending on viewports,
 * forcing 'top: 0' at all times when fixed prevents gaps under the admin bar.
 */

/* State to hide the header - fully hides it offscreen */
.elementor-location-header.header-fixed.header-scroll-hidden,
header.site-header.header-fixed.header-scroll-hidden {
  transform: translateY(-120%) !important;
}

/* State to reveal the header */
.elementor-location-header.header-fixed.header-scroll-visible,
header.site-header.header-fixed.header-scroll-visible {
  transform: translateY(0) !important;
}
