/**
 * Sachin Hummingbird child theme.
 * Colors, fonts and buttons are managed in Homepage Management > Header & Design
 * (module sachinhomepagebuilder); this file only holds the header layout.
 */

/* =========================================
   MAIN HEADER LAYOUT
   Logo → Menu → Search → Sign In → Cart
   ========================================= */

.header-bottom__row {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  width: 100%;
}

/* -------------------------
   LOGO
   ------------------------- */
.header-bottom__logo {
  flex: 0 0 auto !important;
  width: auto !important;
  margin-right: 30px !important;
}

/* Prevent the logo from becoming too large */
.header-bottom__logo img {
  max-width: 140px;
  height: auto;
  display: block;
}


/* -------------------------
   MEGA MENU
   ------------------------- */
.ps-mainmenu--desktop {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0;
  order: 2 !important;
}

/* Menu itself */
.ps-mainmenu__desktop {
  width: 100%;
}

/* Menu links in one row */
.ps-mainmenu__tree {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 25px;
  margin: 0;
  padding: 0;
}


/* -------------------------
   SEARCH
   ------------------------- */
/* Always visible (template: modules/ps_searchbar/ps_searchbar.tpl) */
#shb-searchbar {
  flex: 0 1 260px;
  width: auto; /* Bootstrap gives .row children width: 100% */
  min-width: 160px;
  margin-left: 20px;
  order: 3;
}

#shb-searchbar .ps-searchbar {
  min-width: 0; /* Hummingbird sets 19rem */
  width: 100%;
}

#shb-searchbar .ps-searchbar__input {
  width: 100%;
}

#shb-searchbar .ps-searchbar__dropdown {
  z-index: 1050;
}


/* -------------------------
   SIGN IN
   ------------------------- */
#_desktop_ps_customersignin {
  flex: 0 0 auto !important;
  width: auto !important;
  margin-left: 15px !important;
  order: 4 !important;
}


/* -------------------------
   CART
   ------------------------- */
#_desktop_ps_shoppingcart {
  flex: 0 0 auto !important;
  width: auto !important;
  margin-left: 15px !important;
  order: 5 !important;
}


/* Make account/cart stay visible */
#_desktop_ps_customersignin,
#_desktop_ps_shoppingcart {
  display: block !important;
}


/* -------------------------
   ACCOUNT + CART ALIGNMENT
   ------------------------- */
#_desktop_ps_customersignin .header-block,
#_desktop_ps_shoppingcart .header-block {
  display: flex;
  align-items: center;
  white-space: nowrap;
}


/* -------------------------
   MOBILE
   ------------------------- */
@media (max-width: 1199.98px) {

  /* Logo, menu button and icons on the first line, search on its own line below */
  .header-bottom__row {
    flex-wrap: wrap !important;
  }

  #shb-searchbar {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    margin: 0 0 10px;
    padding-inline: calc(var(--bs-gutter-x) * .5);
    order: 10;
  }

  /* Hide desktop menu */
  .ps-mainmenu--desktop {
    flex: 0 0 auto !important;
  }

  .ps-mainmenu__desktop {
    display: none !important;
  }

  /* Mobile menu button */
  .ps-mainmenu__mobile-toggle {
    display: flex !important;
    align-items: center;
  }

  /* Tablets keep the desktop account/cart blocks (Hummingbird's mobile ones exist only below 768px) */
  #_desktop_ps_customersignin,
  #_desktop_ps_shoppingcart {
    order: 4 !important;
  }

  #_desktop_ps_customersignin {
    margin-left: auto !important;
  }

  #_desktop_ps_shoppingcart {
    order: 5 !important;
  }

  /* Put mobile menu button before account/cart */
  .ps-mainmenu--desktop {
    order: 2 !important;
  }

  #_mobile_ps_customersignin {
    order: 4 !important;
  }

  #_mobile_ps_shoppingcart {
    order: 5 !important;
  }

  /* Mobile logo */
  .header-bottom__logo {
    margin-right: auto !important;
  }

  .header-bottom__logo img {
    max-width: 110px;
  }
}


/* -------------------------
   PHONES (below 768px): mobile account/cart icons
   ------------------------- */
@media (max-width: 767.98px) {

  #_desktop_ps_customersignin,
  #_desktop_ps_shoppingcart {
    display: none !important;
  }

  #_mobile_ps_customersignin,
  #_mobile_ps_shoppingcart {
    display: flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    margin-left: 5px !important;
  }
}


/* -------------------------
   VERY SMALL MOBILE
   ------------------------- */
@media (max-width: 575.98px) {

  .header-bottom__container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .header-bottom__row {
    gap: 3px !important;
  }

  .header-bottom__logo img {
    max-width: 95px;
  }

  #_mobile_ps_customersignin,
  #_mobile_ps_shoppingcart {
    margin-left: 0 !important;
  }

  .header-block__action-btn {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }
}

@media (min-width: 1200px) {
  #_desktop_ps_customersignin .header-block__action-btn {
    padding-top: 20px !important;
    padding-right: 0px !important;
  }

  #_desktop_ps_shoppingcart .header-block__action-btn {
    padding-top: 20px !important;
    padding-left: 0px !important;
  }
}
