/* ============================================
   Search Widget – icon + overlay only
   ============================================ */
#search_widget {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Icon trigger */
#search_widget .search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:0
}

#search_widget .search-toggle img,
#search_widget .search-submit img {
  width: 24px;
  height: 24px;
  display: block;
}

/* Overlay */
#search_widget .search-overlay {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%) translateX(20px);
  z-index: 100;
  background: #fff;
  border: 1px solid #d1d1d1;
  border-radius: 50px;
  height: 44px;
  min-width: 320px;
  max-width: 90vw;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

#search_widget .search-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

#search_widget .search-overlay form {
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0;
}

#search_widget .search-overlay input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 16px;
  font-size: 14px;
  height: 100%;
  background: transparent;
  min-width: 0;
  color: var(--cornero-black);
  border-radius: 50px 0 0 50px;
}

#search_widget .search-submit {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 8px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#search_widget .search-overlay-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 12px 0 4px;
  height: 100%;
  display: flex;
  align-items: center;
  color: #999;
}

#search_widget .search-overlay-close .material-icons {
  font-size: 20px;
}

/* Autocomplete – zostawiam jak było */
.ui-autocomplete.searchbar-autocomplete {
  width: 100%;
  min-height: 100%;
  border: none;
}
.ui-autocomplete.searchbar-autocomplete li a,
.ui-autocomplete.searchbar-autocomplete li a.ui-state-focus {
  padding: 8px 15px;
  overflow: auto;
  border: none;
  background: none;
  margin: auto;
  border-radius: 0;
}
.ui-autocomplete.searchbar-autocomplete li a:hover {
  background-color: #f1f1f1;
  cursor: pointer;
}
.ui-autocomplete.searchbar-autocomplete li a .autocomplete-thumbnail {
  float: left;
  width: 50px;
  height: auto;
  margin-right: 8px;
}

@media only screen and (min-width: 768px) {
  .ui-autocomplete.searchbar-autocomplete {
    width: 400px;
    min-height: auto;
    left: auto;
  }
}

#_desktop_search {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

/* Mobile: overlay full-width pod ikoną */
@media (max-width: 576px) {
  #search_widget .search-overlay {
    position: fixed;
    top: auto;
    left: 8px;
    right: 8px;
    transform: none;
    min-width: 0;
    width: auto;
    max-width: none;
  }
  #search_widget .search-overlay.open {
    transform: none;
  }
}