/* Header fixes: force consistent fixed/sticky behavior on small screens
   - Overrides animations/transforms that cause jumps
   - Locks header height via --kc-header-height (fallback to 110px)
   - Keeps hamburger and mobile nav aligned and fixed
*/
:root {
  --kc-header-height: 110px;
}

@media (max-width: 991px) {
  /* Force header bar fixed on small screens (always) */
  .header-area,
  .header-area .main-header,
  .header-area .top-menu-wrapper,
  .header-area .header-bottom {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: var(--kc-header-height) !important;
    min-height: var(--kc-header-height) !important;
    z-index: 99999 !important;
    background: var(--white) !important;
    transition: none !important;
    transform: none !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06) !important;
  }

  /* Keep header children stable and make key containers positioned */
  .header-area .top-menu-wrapper,
  .header-area .header-bottom,
  .header-area .top-header-left {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 14px !important;
    position: relative !important;
  }

  /* Logo: ensure visible and not clipped */
  .header-area .logo,
  .header-area .logo img,
  .header-area .logo .changeLogo {
    max-height: calc(var(--kc-header-height) * 0.75) !important;
    height: auto !important;
    width: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 100003 !important;
  }

  /* Mobile search & theme button: keep inside header flow so it's visible */
  .search-header-position {
  }

  /* Lock mobile menu/hamburger to the right inside the header */
  .header-area .mobile_menu {
    position: absolute !important;
    top: 0 !important;
    right: 12px !important;
    height: var(--kc-header-height) !important;
    display: flex !important;
    align-items: center !important;
    z-index: 100004 !important;
    width: auto !important;
    pointer-events: auto !important;
  }

  .header-area .mobile_menu .slicknav_menu .slicknav_btn {
    position: relative !important;
    top: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px !important;
  }

  /* Fixed mobile nav panel appears directly under header */
  .header-area .mobile_menu .slicknav_menu .slicknav_nav {
    position: fixed !important;
    top: 100px !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100000 !important;
    background: var(--white) !important;
    padding: 12px 18px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08) !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Keep hidden panel off-screen to avoid layout shifts */
  .header-area .mobile_menu .slicknav_menu .slicknav_nav.slicknav_hidden {
    top: -9999px !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  /* Add top padding so page content isn't covered by the fixed header */
  body {
    padding-top: var(--kc-header-height) !important;
  }
}

/* Mobile slicknav socials: simple horizontal icons inside mobile nav panel */
@media (max-width: 991px) {
  .slicknav_socials {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 12px 8px 6px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.04) !important;
    margin-top: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .slicknav_socials .social-icon {
    display: inline-flex !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: var(--secondary-border, #f0f0f0) !important;
    color: var(--primary-title, #333) !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    font-size: 14px !important;
  }

  .slicknav_socials .social-icon i {
    font-size: 14px !important;
    line-height: 1 !important;
  }
}
