/* Contenedor en el encabezado (mismo lugar que el buscador anterior del tema) */
.tecnid-search-host {
  display: inline-block;
  vertical-align: middle;
  width: min(870px, 48vw);
  padding: 10px 0;
}
.tecnid-search-host--displaymobiletopsitemap { display: block; width: 100%; padding: 8px 0; }
@media (max-width: 991px) {
  .tecnid-search-host { display: block; width: 100%; }
}

/* Tecnid Search — los colores se ajustan cambiando estas variables */
.tecnid-search {
  --ts-bg: #f2f2f2;
  --ts-bg-focus: #ffffff;
  --ts-text: #1d1d1f;
  --ts-muted: #6e6e73;
  --ts-border: #e3e3e6;
  --ts-hover: #f5f5f7;
  --ts-accent: #8a2be2;
  --ts-mark: rgba(138, 43, 226, 0.12);
  --ts-danger: #c4302b;
  --ts-radius: 999px;
  --ts-panel-radius: 18px;

  position: relative;
  width: 100%;
  max-width: 880px;
  font: inherit;
  color: var(--ts-text);
}

.tecnid-search__form {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}

.tecnid-search__input {
  width: 100%;
  height: 56px;
  padding: 0 96px 0 32px;
  border: 1px solid transparent;
  border-radius: var(--ts-radius);
  background: var(--ts-bg);
  color: var(--ts-text);
  font: inherit;
  font-size: 1.05rem;
  outline: none;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.tecnid-search__input::placeholder { color: var(--ts-muted); }
.tecnid-search__input::-webkit-search-cancel-button,
.tecnid-search__input::-webkit-search-decoration { -webkit-appearance: none; }
.tecnid-search__input:focus {
  background: var(--ts-bg-focus);
  border-color: var(--ts-border);
  box-shadow: 0 0 0 3px var(--ts-mark);
}

.tecnid-search__submit,
.tecnid-search__clear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--ts-text);
  cursor: pointer;
  border-radius: 50%;
}
.tecnid-search__submit { right: 14px; width: 44px; height: 44px; }
.tecnid-search__clear { right: 58px; width: 32px; height: 32px; color: var(--ts-muted); }
.tecnid-search__clear[hidden] { display: none; }
.tecnid-search__submit:focus-visible,
.tecnid-search__clear:focus-visible { outline: 2px solid var(--ts-accent); outline-offset: 2px; }

/* Indicador de carga: el ícono de la lupa late suavemente */
.tecnid-search.is-loading .tecnid-search__submit svg { animation: tecnid-pulse .8s ease-in-out infinite alternate; }
@keyframes tecnid-pulse { from { opacity: 1; } to { opacity: .35; } }

/* Panel */
.tecnid-search__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1050;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid var(--ts-border);
  border-radius: var(--ts-panel-radius);
  box-shadow: 0 18px 40px -12px rgba(29, 29, 31, 0.22);
  padding: 8px;
}
.tecnid-search__panel[hidden] { display: none; }

.tecnid-search__list { list-style: none; margin: 0; padding: 0; }

.tecnid-search__item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--ts-text);
  text-decoration: none;
}
.tecnid-search__item:hover,
.tecnid-search__item.is-active { background: var(--ts-hover); color: var(--ts-text); text-decoration: none; }

.tecnid-search__thumb { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.tecnid-search__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tecnid-search__noimg { width: 40px; height: 40px; border-radius: 8px; background: var(--ts-hover); }

.tecnid-search__info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tecnid-search__name {
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tecnid-search__name mark { background: none; color: inherit; font-weight: 700; padding: 0; }
.tecnid-search__meta { font-size: .85rem; color: var(--ts-muted); }
.tecnid-search__oos { color: var(--ts-danger); margin-left: 6px; }

.tecnid-search__price { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.tecnid-search__price strong { font-weight: 700; }
.tecnid-search__price s { font-size: .8rem; color: var(--ts-muted); }

.tecnid-search__more {
  display: block;
  margin-top: 4px;
  padding: 14px 12px;
  border-top: 1px solid var(--ts-border);
  border-radius: 0 0 12px 12px;
  text-align: center;
  font-weight: 600;
  color: var(--ts-accent);
  text-decoration: none;
}
.tecnid-search__more:hover,
.tecnid-search__more.is-active { background: var(--ts-hover); color: var(--ts-accent); text-decoration: none; }

.tecnid-search__status { padding: 18px 12px; color: var(--ts-muted); text-align: center; }
.tecnid-search__status[hidden] { display: none; }

@media (max-width: 767px) {
  .tecnid-search__input { height: 48px; padding-left: 20px; font-size: 16px; } /* 16px evita el zoom en iPhone */
  .tecnid-search__panel { max-height: 75vh; padding: 6px; }
  .tecnid-search__item { grid-template-columns: 48px 1fr auto; gap: 10px; padding: 8px; }
  .tecnid-search__thumb { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .tecnid-search *, .tecnid-search { transition: none !important; animation: none !important; }
}
