/* Anchor mobile search to the header row, rather than the right-hand icon.
   Author: Hassan Thini. Theme still controls open/close and search submission. */
@media (max-width: 849px) {
  #header .mobile-nav:has(.header-search-dropdown),
  #header .mobile-nav .header-search-dropdown { position: static !important; }
  #header .mobile-nav .header-search-dropdown > .nav-dropdown {
    box-sizing: border-box;
    min-width: 0 !important;
    max-width: calc(100vw - 24px) !important;
    padding: 12px !important;
    border: 1px solid #eadfea;
    border-radius: 12px;
    box-shadow: 0 8px 24px #3325361a;
    background: #fff;
  }
  #header .mobile-nav .header-search-dropdown.current-dropdown > .nav-dropdown {
    display: block !important;
    top: 100% !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    margin: 0 !important;
    transform: none !important;
  }
  #header .mobile-nav .header-search-dropdown::before,
  #header .mobile-nav .header-search-dropdown::after { display: none !important; }
  #header .mobile-nav .header-search-form { padding: 0 !important; }
  #header .mobile-nav .header-search-form,
  #header .mobile-nav .header-search-form-wrapper,
  #header .mobile-nav .searchform-wrapper,
  #header .mobile-nav .searchform { width: 100%; min-width: 0; margin: 0; }
  #header .mobile-nav .searchform > .flex-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: stretch;
    gap: 0;
  }
  #header .mobile-nav .searchform > .flex-row:has(.search-form-categories) {
    grid-template-columns: minmax(0, 96px) minmax(0, 1fr) 44px;
  }
  #header .mobile-nav .searchform .flex-col { min-width: 0; margin: 0; }
  #header .mobile-nav .search_categories {
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    padding-left: 8px;
    padding-right: 23px;
    font-size: 14px;
  }
  #header .mobile-nav .search-field {
    width: 100%; min-width: 0; max-width: 100%; font-size: 16px;
  }
  #header .mobile-nav .search-field,
  #header .mobile-nav .search_categories,
  #header .mobile-nav .ux-search-submit { height: 44px; min-height: 44px; margin: 0; }
  #header .mobile-nav .ux-search-submit { width: 44px; min-width: 44px; padding: 0; }
  #header .mobile-nav .live-search-results .autocomplete-suggestions {
    box-sizing: border-box; left: 0 !important; right: 0 !important;
    width: 100% !important; min-width: 0 !important; max-width: 100%;
    max-height: 45vh !important; overflow-y: auto;
  }
}
