/* =========================
   LIGHT THEME – Searchbar
   ========================= */

.hm-searchbar{
  position: relative;
}

/* dropdown box */
.hm-searchbar__suggest{
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  z-index: 99999;
  padding: 10px;
  border-radius:0px;
}

/* top row with count + pager */
.hm-searchbar__suggestTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 4px 2px 10px;
}

.hm-searchbar__suggestCount{
  opacity: .7;
  font-size: 13px;
  color: rgba(0,0,0,.75);
}

.hm-searchbar__pager{
  display:flex;
  gap: 6px;
}

.hm-searchbar__prev,
.hm-searchbar__next{
  border: 1px solid rgba(0,0,0,.12);
  background: #f2f2f2;
  color: #111;
  cursor: pointer;

  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 18px;
  box-shadow: none;
  border-radius: 8px;
}

.hm-searchbar__prev:hover,
.hm-searchbar__next:hover{
  background: rgba(0,0,0,.06);
}

.hm-searchbar__prev:disabled,
.hm-searchbar__next:disabled{
  opacity: .4;
  cursor: not-allowed;
}

/* list */
.hm-searchbar__suggestList{
  list-style:none;
  margin:0;
  padding:0;

  /* you said only 4 items per page -> keep it compact */
  max-height: 360px;
  overflow:auto;
}

.hm-searchbar__suggestItem{
  border-top: 1px solid rgba(0,0,0,.06);
}
.hm-searchbar__suggestItem:first-child{ border-top:0; }

.hm-searchbar__suggestLink{
  display:flex;
  gap: 14px;
  padding: 12px 8px;
  text-decoration:none;
  color:#111;
  border-radius: 10px;
}

.hm-searchbar__suggestLink:hover{
  background: rgba(0,0,0,.04);
}

.hm-searchbar__thumb{
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.hm-searchbar__meta{
  display:flex;
  flex-direction:column;
  gap: 6px;
  min-width: 0;
}

.hm-searchbar__title{
  font-size: 14px;
  line-height: 1.2;
  opacity: .95;
  overflow-wrap:anywhere;
  color: rgba(0,0,0,.9);
}

.hm-searchbar__price{
  font-size: 13px;
  opacity: .75;
  color: rgba(0,0,0,.75);
}

.hm-searchbar__all{
  display:block;
  margin-top: 10px;
  text-decoration:none;
  padding: 12px 10px;

  background: #f5f5f5;
  border: 1px solid rgba(0,0,0,.10);
  color:#111;
  font-weight: 700;
  text-align: center;
  border-radius: 0px;
}

.hm-searchbar__all:hover{
  background: #eeeeee;
}

/* link colors inside dropdown */
.hm-searchbar__suggest a,
.hm-searchbar__suggest a:visited{
  color: #111 !important;
}

/* Ensure dropdown height behavior (your previous overrides) */
.hm-searchbar__suggest,
.hm-searchbar__suggestList{
  height: auto !important;
  max-height: none !important;
}

.hm-searchbar__suggestViewport{
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 0;
}

button.hm-searchbar__submit{
  border-radius: 0 !important;
}

/* =========================
   LIGHT THEME – Select2
   ========================= */

/* Middle dropdown block */
.hm-searchbar__selectWrap{
  width: 170px;
  flex: 0 0 170px;
  min-width: 170px;                 /* FIX: was 220px (conflicted with width/flex) */
  border-left: 1px solid #acacac;
  position: relative;
}

.hm-searchbar__select{
  width: 100%;
}

/* Select2 container follows wrapper width */
.hm-s2.select2-container{
  width: 100% !important;
}

/* Closed control */
.hm-s2 .select2-selection--single{
  height: 42px !important;
  background: #ffffff !important;
  border: 1px solid rgba(0,0,0,.12) !important;
  border-radius: 0 !important;
}

.hm-s2 .select2-selection__rendered{
  line-height: 42px !important;
  color: #111 !important;
  padding-left: 12px !important;
  padding-right: 28px !important;
}

/* Arrow wrapper */
.hm-s2 .select2-selection__arrow{
  height: 42px !important;
  right: 8px;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* FIX: force triangle caret so it doesn't disappear on open */
.hm-s2 .select2-selection__arrow b{
  border-style: solid !important;
  border-width: 6px 5px 0 5px !important;  /* down caret */
  border-color: #111 transparent transparent transparent !important;
  margin-left: -5px !important;
  margin-top: -3px !important;
}

/* Open state caret (up) */
.hm-s2.select2-container--open .select2-selection__arrow b{
  border-width: 0 5px 6px 5px !important;
  border-color: transparent transparent #111 transparent !important;
}

/* Open dropdown = light “card” */
.hm-s2-dd.select2-dropdown{
 /* margin-top: 40px;*/
  width: 218px !important;
  min-width: 170px !important;
  max-width: 218px !important;

  background: #ffffff;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 0 !important;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

/* Smaller rows + allow wrap */
.hm-s2-dd .select2-results__option{
  padding: 8px 10px !important;
  line-height: 1.15;
  white-space: normal;
  word-break: break-word;
  color: #111;
}

.hm-s2-dd .select2-results__options{
  max-height: 220px !important;
}

/* Dropdown (below or above) */
.select2-container.select2-container--open .select2-dropdown--below,
.select2-container.select2-container--open .select2-dropdown--above{
  border-radius: 0 !important;
}

/* Hide your old custom arrow (not needed with Select2) */
.hm-searchbar__selectWrap:after{
  display: none;
}



/* default language (LT) */
.select2-container--open .hm-s2-dd.select2-dropdown{
  top: calc(100% + 40px) !important;
  margin-top: 0px !important;
}

/* when translated to another language */
html:not([lang^="lt"]) .select2-container--open .hm-s2-dd.select2-dropdown{
  top: calc(100% + 6px) !important;
  margin-top: 0 !important;
}