/* Contenitore responsivo fino a 1200px */
.xg-search-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

/* Wrapper */
.xg-search-wrap {
  position: relative;
  width: 100%;
}

/* Input con lente integrata a destra */
.xg-search-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 14px; /* spazio a destra per la lente */
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #fff;

  /* Lente come background SVG (color #9aa0a6) */
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>\
<path fill='%239aa0a6' d='M15.5 14h-.79l-.28-.27a6.2 6.2 0 1 0-.71.71l.27.28v.79L20 21.5 21.5 20l-6-6zm-6.3 0A4.7 4.7 0 1 1 13.9 9.3 4.7 4.7 0 0 1 9.2 14z'/>\
</svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;

  outline: none;
  transition: box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
  font-size: 15px;
  line-height: 1;
}
.xg-search-input::placeholder { color: #9aa0a6; }
.xg-search-input:focus {
  border-color: #cfd4dc;
  box-shadow: 0 8px 24px rgba(0,0,0,.06), 0 0 0 4px rgba(43,123,255,.08);
}

/* Pannello risultati */
.xg-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,.10);
  z-index: 1000;
  max-height: 60vh;
  overflow: auto;
  padding: 6px;
}

/* Item: immagine + titolo */
.xg-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  padding: 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  align-items: center;
  transition: background .15s ease;
}
.xg-item:hover,
.xg-item.is-active { background: #f7f8fa; }

.xg-thumb {
  width: 48px; height: 48px;
  border-radius: 8px; overflow: hidden;
  background:#fafafa;
  display:flex; align-items:center; justify-content:center;
}
.xg-thumb img { width: 100%; height: 100%; object-fit: cover; }

.xg-title {
  font-weight: 600;
  line-height: 1.2;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* tronca su 2 righe */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.xg-empty { padding: 10px; color: #666; font-size: 14px; }

@media (max-width: 480px) {
  .xg-search-input { height: 46px; border-radius: 10px; }
}