/* ================================
   Smart Page Search — адаптивний стиль
================================ */

.smart-search-container {
  position: relative;
  max-width: 360px;
  margin: 0 auto;
}

/* 🔹 Форма */
#smart-search-form {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#smart-search-form:focus-within {
  border-color: #999;
  box-shadow: 0 0 0 3px rgba(170,170,170,0.2);
}

/* 🔸 Поле вводу */
#smart-search-input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: #333;
  border-radius: 30px 0 0 30px;
  box-shadow: none !important; /* Прибирає сіру смугу під полем */
}

/* 🔸 Кнопка з лупою */
#smart-search-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin-right: 6px;
  background: #ccc; /* світло-сірий */
  border: none;
  border-radius: 50% !important;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
  box-sizing: border-box;
}

#smart-search-btn:hover {
  background: #999; /* темніший при наведенні */
  transform: scale(1.05);
}

/* SVG-лупа */
#smart-search-btn svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  display: block;
}

/* 🔹 Результати пошуку */
#smart-search-results {
  position: absolute;
  top: 105%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

#smart-search-results:empty {
  display: none !important; /* Повністю ховає блок, коли він порожній */
}

#smart-search-results a {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s ease;
}

#smart-search-results a:hover {
  background: #f8f8f8;
}

/* ================================
   📱 Адаптивність
================================ */

/* --- Планшети (до 1024px) --- */
@media (max-width: 1024px) {
  .smart-search-container {
    max-width: 80%;
  }

  #smart-search-input {
    font-size: 14.5px;
    padding: 9px 12px;
  }

  #smart-search-btn {
    width: 38px;
    height: 38px;
  }

  #smart-search-btn svg {
    width: 17px;
    height: 17px;
  }
}

/* --- Мобільні (до 768px) --- */
@media (max-width: 768px) {
  .smart-search-container {
    max-width: 95%;
    margin: 0 8px;
  }

  #smart-search-form {
    border-radius: 25px;
  }

  #smart-search-input {
    font-size: 14px;
    padding: 9px 10px;
  }

  #smart-search-btn {
    width: 34px;
    height: 34px;
    margin-right: 5px;
  }

  #smart-search-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* --- Дуже маленькі екрани (до 480px) --- */
@media (max-width: 480px) {
  .smart-search-container {
    max-width: 100%;
    margin: 0 6px;
  }

  #smart-search-input {
    font-size: 13.5px;
    padding: 8px 8px;
  }

  #smart-search-btn {
    width: 32px;
    height: 32px;
  }

  #smart-search-btn svg {
    width: 15px;
    height: 15px;
  }
}
