/* =============================================================================
   AirProSys – Custom Header Layout for Hummingbird
   Structure:
     Top bar   → Contact info + Language/Currency
     Row 1     → Logo | Search bar | User icon | Cart icon
     Row 2     → Full-width categories bar
   ============================================================================= */

/* ─── Top bar adjustments ────────────────────────────────────────────────────── */
/* Hide user/cart icons from the top bar (they are moved to Row 1 via JS) */
.header-top__right #_desktop_user_info,
.header-top__right #_desktop_cart {
  display: none !important;
}

/* ─── Row 1: Main header row ─────────────────────────────────────────────────── */
.airpro-header-row1 {
  background: #fff;
  padding: 0;
  border-bottom: 1px solid var(--bs-gray-200, #e9ecef);
}

.airpro-header-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.625rem 0;
  min-height: 4.25rem;
}

/* Logo */
.airpro-header-logo {
  flex-shrink: 0;
}

.airpro-header-logo .navbar-brand {
  max-width: 200px;
  max-height: 55px;
  padding: 0;
  margin: 0;
}

.airpro-header-logo .logo {
  width: auto;
  max-height: 55px;
  display: block;
}

/* Search bar */
.airpro-header-search {
  flex: 1;
  max-width: 850px;
  align-items: center;
  margin: 0 auto;
}

.airpro-header-search #search_widget {
  width: 100%;
  min-width: 100% !important;
  overflow: visible;
  position: relative;
}

.airpro-header-search #search_widget input[type="search"] {
  width: 100%;
  height: 2.75rem;
  padding: 0 3.25rem 0 1.25rem;
  background: var(--bs-gray-100, #f3f4f6);
  border: 2px solid var(--bs-gray-300, #dee2e6);
  border-radius: 100rem;
  font-size: 0.9rem;
  color: var(--bs-body-color, #212529);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.airpro-header-search #search_widget input[type="search"]:focus {
  outline: 0;
  border-color: var(--bs-primary, #0d6efd);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
  background-color: #fff;
}

.airpro-header-search #search_widget input[type="search"]::placeholder {
  color: var(--bs-gray-500, #adb5bd);
}

.airpro-header-search #search_widget .search {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bs-gray-600, #6c757d);
  cursor: pointer;
  z-index: 2;
}

.airpro-header-search #search_widget .clear {
  position: absolute;
  right: 3rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bs-gray-600, #6c757d);
  cursor: pointer;
  z-index: 2;
}

/* Search dropdown results */
.airpro-header-search .search-widgets__dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  z-index: 1060;
  background: #fff;
  border: 1px solid var(--bs-gray-200, #e9ecef);
  border-radius: var(--bs-border-radius, 0.375rem);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
}

/* Desktop actions container (user + cart icons) */
.airpro-header-actions {
  align-items: center;
  gap: 0.125rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Make sure the icons inside look right when moved */
.airpro-header-actions .header-block {
  display: flex;
  align-items: center;
}

.airpro-header-actions .header-block__action-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--bs-border-radius, 0.375rem);
  transition: background-color 0.2s ease, color 0.2s ease;
  color: var(--bs-body-color, #212529);
  text-decoration: none;
  position: relative;
  white-space: nowrap;
}

.airpro-header-actions .header-block__action-btn:hover {
  background-color: var(--bs-gray-100, #f3f4f6);
  color: var(--bs-primary, #0d6efd);
}

.airpro-header-actions .header-block__icon {
  font-size: 1.5rem;
}

.airpro-header-actions .header-block__title {
  font-size: 0.8125rem;
  font-weight: 500;
}

.airpro-header-actions .header-block__badge {
  position: absolute;
  top: 0.125rem;
  right: 0.25rem;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 100rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Cart active state */
.airpro-header-actions .header-block--active .header-block__action-btn {
  color: var(--bs-primary, #0d6efd);
}

/* Mobile actions */
.airpro-header-actions-mobile {
  align-items: center;
  gap: 0;
  margin-left: auto;
  flex-shrink: 0;
}

.airpro-header-actions-mobile .header-block__action-btn {
  padding: 0.5rem;
  position: relative;
}

.airpro-header-actions-mobile .header-block__badge {
  position: absolute;
  top: 0;
  right: -0.125rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.1875rem;
  background: var(--bs-primary, #0d6efd);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 100rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* User dropdown menu positioning fix */
.airpro-header-actions .dropdown-menu {
  right: 0;
  left: auto;
  min-width: 14rem;
  border: 1px solid var(--bs-gray-200, #e9ecef);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12);
  border-radius: var(--bs-border-radius, 0.375rem);
}


/* ─── Row 2: Categories bar ──────────────────────────────────────────────────── */
.airpro-categories-bar {
  background: var(--bs-primary, #0d6efd);
  width: 100%;
  position: relative;
  z-index: 90;
}

.airpro-categories-bar__inner {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}

/* Main menu: full width */
.airpro-categories-bar .main-menu {
  width: 100%;
  order: 0 !important;
  flex: 1;
}

/* Force desktop menu visible in categories bar */
.airpro-categories-bar .main-menu .js-menu-desktop {
  display: block !important;
  position: static;
}

/* Menu tree: horizontal, centered */
.airpro-categories-bar .main-menu__tree {
  display: flex !important;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
  width: 100%;
}

.airpro-categories-bar .main-menu__tree > li {
  position: relative;
}

.airpro-categories-bar .main-menu__tree > li > a,
.airpro-categories-bar .main-menu__tree > li > .main-menu__tree__link {
  display: flex;
  align-items: center;
  padding: 0.8125rem 1.125rem;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
  height: 100%;
}

.airpro-categories-bar .main-menu__tree > li > a:hover,
.airpro-categories-bar .main-menu__tree > li.current > a,
.airpro-categories-bar .main-menu__tree > li > .main-menu__tree__link:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff !important;
}

/* Dropdown submenus */
.airpro-categories-bar .menu-container {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
  display: none;
  background: #fff;
  border-top: 3px solid var(--bs-primary, #0d6efd);
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
  border-radius: 0 0 0.5rem 0.5rem;
  min-width: 16rem;
  padding: 0.75rem 0;
}

.airpro-categories-bar .main-menu__tree > li:hover > .menu-container,
.airpro-categories-bar .menu-container.focusing,
.airpro-categories-bar .menu-container:focus-within {
  display: block;
}

.airpro-categories-bar .menu-container a {
  color: var(--bs-body-color, #212529) !important;
}

.airpro-categories-bar .menu-container a:hover {
  color: var(--bs-primary, #0d6efd) !important;
  background-color: var(--bs-gray-100, #f3f4f6);
}

/* Hide the search widget that comes from displayTop inside categories bar */
.airpro-categories-bar #_desktop_search,
.airpro-categories-bar .search-widgets,
.airpro-categories-bar [id="search_widget"] {
  display: none !important;
}

/* Hide mobile hamburger from categories bar (it's handled elsewhere) */
.airpro-categories-bar .main-menu > .header-block.d-xl-none {
  display: none !important;
}

/* Hide categories bar on mobile (menu accessible via hamburger) */
@media (max-width: 1199.98px) {
  .airpro-categories-bar {
    display: none;
  }
}


/* ─── Mobile layout ──────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .airpro-header-main {
    gap: 0.375rem;
    padding: 0.375rem 0;
    min-height: 3.25rem;
    flex-wrap: nowrap;
  }

  .airpro-header-logo .navbar-brand {
    max-width: 130px;
    max-height: 38px;
  }

  .airpro-header-logo .logo {
    max-height: 38px;
  }
}

/* ─── Ensure no layout shifts ────────────────────────────────────────────────── */
/* Hide the original header-bottom row used by Hummingbird if rendered */
.header-bottom__row:not(.airpro-header-main) {
  /* Only apply if the old row somehow coexists */
}

/* Remove default order on the main menu inside categories bar */
.airpro-categories-bar .main-menu {
  order: unset !important;
}
