/* Gooey search (shortcode) */
.u1gs {
  --u1gs-w: 761px;
  --u1gs-h: 46px;
  --u1gs-r: 999px;
  --u1gs-pad: 20px;
  --u1gs-bg: rgba(255, 255, 255, 0.9);
  --u1gs-border: #28462F;
  --u1gs-focus-border: #003D24;
  --u1gs-text: #111827;
  --u1gs-accent: #003D24;
  
  font-family: "Noto Sans Armenian", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  width: min(var(--u1gs-w), 100%);
  position: relative;
  margin: 0 auto;
}

.u1gs-svg { position: absolute; width: 0; height: 0; }

/* Форма поиска */
.u1gs-form {
  position: relative;
  width: 100%;
  height: var(--u1gs-h);
  border-radius: var(--u1gs-r);
  border: 1px solid var(--u1gs-border);
  background: var(--u1gs-bg);
  display: flex;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.u1gs.is-focus .u1gs-form {
  border-color: var(--u1gs-focus-border);
  box-shadow: 0 0 0 3px rgba(40, 70, 47, 0.4);
  background: #fff;
}

/* Инпут */
.u1gs-input {
  flex: 1;
  height: 100%;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--u1gs-text);
  font-size: 15px;
  font-weight: 500;
  padding: 0 0 0 var(--u1gs-pad);
  margin: 0;
  width: 100%;
}
.u1gs-input::placeholder { color: #9CA3AF; opacity: 1; }

/* Блок кнопок справа */
/* Блок кнопок справа */
.u1gs-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 0;
  padding-left: 4px;
  height: 100%;
  flex-shrink: 0;
}

/* Кнопка поиска (Лупа) */
.u1gs-btn {
  height: 100% !important;
  aspect-ratio: 1 !important;
  min-width: unset !important;
  max-width: unset !important;
  border-radius: 0 !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  background: #003D24 !important;
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: none;
}
.u1gs-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(0, 61, 36, 0.4);
}
.u1gs-btn:active { transform: scale(0.95); }

/* КНОПКА ОЧИСТКИ (X) - Обновленная */
.u1gs-clear {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  flex-shrink: 0 !important;
  border: none !important;
  padding: 0 !important;
  background: transparent !important; /* Всегда прозрачный фон */
  color: #9CA3AF !important; /* Цвет крестика по умолчанию (серый) */
  cursor: pointer;
  
  /* Логика скрытия */
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  pointer-events: none;
  
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.u1gs-clear svg {
  width: 18px; /* Чуть увеличил сам крестик для удобства */
  height: 18px;
  stroke-width: 2.5;
}

/* Показываем X только когда есть текст */
.u1gs.has-value .u1gs-clear {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  pointer-events: auto;
}

/* Эффект при наведении на X */
.u1gs-clear:hover {
  background: transparent !important; /* Фона НЕТ */
  color: #111827 !important; /* Крестик становится черным */
  transform: scale(1.1); /* Легкое увеличение для эффекта нажатия */
}

/* Скрываем дубликаты поиска темы */
.whb-header .wd-search-form,
.whb-header .wd-header-search { display: none !important; }
.whb-sticky-row .u1gs { display: none; }

/* Попап результатов */
.u1gs-pop {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}
.u1gs-pop[style*="display: block"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.u1gs-panel {
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.u1gs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
}

.u1gs-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  text-decoration: none !important;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.2s ease;
}
.u1gs-item:hover { background: #F9FAFB; border-color: #E5E7EB; }
.u1gs-item img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.u1gs-name { font-size: 14px; font-weight: 600; color: #111827; line-height: 1.3; margin-bottom: 2px; }
.u1gs-price { font-size: 13px; color: ##003D24; font-weight: 600; }

/* Тексты и Смайлик */
.u1gs-empty { padding: 24px; text-align: center; }

.u1gs-sad {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
  animation: u1gs-fadeIn 0.5s ease;
  color: #9CA3AF;
}

.u1gs-title { font-size: 16px; font-weight: 700; color: #111827; }
.u1gs-sub { font-size: 13px; color: #6B7280; margin-top: 4px; }
.u1gs-rec-title { padding: 12px 12px 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #9CA3AF; }

@keyframes u1gs-fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .u1gs-grid { grid-template-columns: 1fr; }
}