/* Overlay hidden by default */
#search-box-meili {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  overflow: auto;
  transition: all 0.3s ease;
}

#search-box-meili.active {
  display: block;
}

/* Inner container centered */
#search-box-meili .search-overlay-inner {
  position: relative;
  max-width: 1200px;
  margin: 5% auto;
  padding: 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Close button */
#search-close-btn {
  position: absolute;
  top: 30px;
  right: 0px;
  font-size: 30px;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  transition: 0.2s ease;
}

#search-close-btn:hover {
  color: #2fb5d2;
}

/* Search input style */
#search-box-meili .action.input {
    position: relative;
    width: 100%;
    margin-bottom:20px;
}

/* Input prend 100% de largeur avec padding droit pour le bouton */
#search-box-meili #search-query-meili {
    width: 100%;
    padding: 12px 60px 12px 20px; /* padding droit = largeur bouton + marge */
    font-size: 16px;
    border-radius: 36px;
    border: 1px solid rgba(0,0,0,0.25);
    box-sizing: border-box; /* inclut padding dans largeur */
}

/* Bouton recherche positionné à droite de l'input */
#search-box-meili .submit-search {
    position: absolute;
    top: 50%;
    right: 10px;             /* distance du bord droit */
    transform: translateY(-50%);
    background-color: rgb(185, 141, 97);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    cursor: pointer;
}

/* Icone dans le bouton */
#search-box-meili .submit-search i {
    font-size: 22px;
    line-height: 1;
}

/* Search results table */
#table-result-search-meili {
  width: 100%;
  overflow-y: auto;
  border-collapse: collapse;
}

#table-result-search-meili tr:hover {
  background-color: #efefef;
}

.products-miniatures {
    display: flex;
    flex-wrap: wrap;
}

.product-miniature {
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.product-miniature img {
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.product-title {
    font-size: 0.9rem;
    margin: 8px 0 4px;
}

.product-price {
    color: #2fb5d2;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
  #search-box-meili .search-overlay-inner {
    width: 90%;
    padding: 20px;
  }

  #search-box-meili .submit-search {
    width: 36px;
    height: 36px;
  }
}
