/* 
 * Search form alignment fix
 * Ensures that the search button and input field are always at the same height level
 * across all browsers and screen resolutions
 */

#adsearch-form {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

#adsearch-form .input-ts {
  height: 35px;
  box-sizing: border-box;
  padding: 0 10px;
  flex: 1;
  border-radius: 0;
  vertical-align: middle;
  min-width: 0; /* Prevents flex item from overflowing */
}

#adsearch-form .but-search {
  height: 35px;
  width: 36px;
  min-width: 36px; /* Ensures button maintains minimum width */
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: url(../img/but-search.jpg) no-repeat; /* Ensure background image is visible */
  flex-shrink: 0; /* Prevents button from shrinking */
}

/* Ensure consistent styling across browsers */
#adsearch-form input, 
#adsearch-form button {
  line-height: normal;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Responsive adjustments */
@media screen and (max-width: 660px) {
  #adsearch-form {
    width: 100%;
  }
  
  #adsearch-form .input-ts {
    width: calc(100% - 36px);
  }
  
  /* Ensure button is visible on mobile */
  #adsearch-form .but-search {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* Fix for header-mobile-search section */
.header-mobile-search #search {
  width: 100%;
  padding: 0px;
  display: flex;
  justify-content: center;
}

.header-mobile-search #adsearch-form {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  margin-left: 0;
}

/* Additional mobile-specific styles */
@media screen and (max-width: 480px) {
  #search {
    display: flex;
    justify-content: center;
  }
  
  #adsearch-form {
    max-width: 300px;
    margin: 0 auto;
  }
  
  .header-column-third #search {
    margin-left: auto;
    margin-right: auto;
  }
}
