.gm-ajax-search{
  position: relative;
  width: 100%;
  max-width: 560px; /* input max */
}

/* input */
.gm-ajax-search__wrap { position: relative; }
.gm-ajax-search__input{
  width:100%;
  padding:14px 44px 14px 14px;
  border-radius:16px;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  outline:none;
  box-sizing: border-box;
}
.gm-ajax-search__input:focus{
  border-color: rgba(22,100,230,.55);
  box-shadow: 0 0 0 4px rgba(22,100,230,.12);
}

/* spinner */
.gm-ajax-search__spinner{
  position:absolute;
  right:14px;
  top:50%;
  width:18px;
  height:18px;
  transform: translateY(-50%);
  border-radius:50%;
  border:2px solid rgba(0,0,0,.15);
  border-top-color: rgba(22,100,230,.9);
  opacity:0;
  pointer-events:none;
  animation: gmspin .8s linear infinite;
}
.gm-ajax-search.is-loading .gm-ajax-search__spinner{ opacity:1; }
@keyframes gmspin { to { transform: translateY(-50%) rotate(360deg); } }

/* ====== KEY FIX: dropdown width is NOT constrained by parent ====== */
.gm-ajax-search__results{
  position:absolute;
  top: calc(100% + 10px);

  /* Center under input */
  left: 50%;
  transform: translateX(-50%);

  /* Wider than parent if needed */
  width: min(720px, calc(100vw - 24px));

  background:#fff;
  border:1px solid rgba(0,0,0,.10);
  border-radius:18px;
  box-shadow: 0 18px 40px rgba(0,0,0,.14);
  overflow:auto;
  max-height: min(60vh, 440px);
  display:none;
  z-index: 999999;
  padding: 8px;
  box-sizing: border-box;

  /* makes scrollbar not shift layout */
  scrollbar-gutter: stable;
}
.gm-ajax-search__results.is-open{ display:block; }

/* item base */
.gm-ajax-search__item{
  border-radius: 16px;
  margin: 6px 0;
  padding: 12px 12px;
  text-decoration:none;
  color:inherit;
  background: #fff;
  transition: background .12s ease;
}
.gm-ajax-search__item:hover{ background: rgba(22,100,230,.06); }

/* products row */
.gm-ajax-search__item.is-product{
  display:grid;
  grid-template-columns: 44px 1fr auto;
  align-items:center;
  gap:12px;
}

/* pages row */
.gm-ajax-search__item.is-page{
  display:grid;
  grid-template-columns: 34px 1fr;
  align-items:center;
  gap:12px;
}

.gm-ajax-search__thumb{
  width:44px; height:44px;
  border-radius:14px;
  object-fit:cover;
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
}
.gm-ajax-search__thumb--empty{
  width:44px; height:44px;
  border-radius:14px;
  border:1px dashed rgba(0,0,0,.12);
  background:rgba(0,0,0,.02);
}

.gm-ajax-search__icon{
  width:34px; height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 14px;
  background: rgba(22,100,230,.08);
  border: 1px solid rgba(22,100,230,.18);
  color: rgba(22,100,230,.95);
}

.gm-ajax-search__mid{ min-width: 0; }
.gm-ajax-search__title{
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gm-ajax-search__meta{
  margin-top: 4px;
  font-size: 12px;
  opacity: .65;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gm-ajax-search__stock{
  margin-top: 5px;
  font-size: 12px;
  opacity: .85;
}

.gm-ajax-search__right{
  text-align: right;
  margin-left: 10px;
  white-space: nowrap;
}
.gm-ajax-search__price{ font-weight: 750; }
.gm-ajax-search__price .amount{ font-weight: 750; }

.gm-ajax-search__empty{
  padding: 12px 14px;
  opacity: .75;
}

/* highlight */
.gm-ajax-search__hl{
  background: rgba(22,100,230,.18);
  padding: 0 .18em;
  border-radius: .35em;
}

/* sticky "see all" so last item doesn't get cut */
.gm-ajax-search__all{
  position: sticky;
  bottom: 0;
  display:block;
  margin-top: 8px;
  padding:12px 14px;
  text-decoration:none;
  font-weight: 750;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 -8px 20px rgba(0,0,0,.06);
}
.gm-ajax-search__all:hover{ background: rgba(22,100,230,.06); }

/* mobile: keep it full width with small margins */
@media (max-width: 640px){
  .gm-ajax-search{ max-width: 100%; }
  .gm-ajax-search__results{
    width: calc(100vw - 16px);
  }
}
