/* Fondazione Sozzani – ricerca prodotti
   Aspetto coerente con il form della ricerca generica.
   Incollare questo contenuto in assets/css/search-products.css.
   Non modifica il popup di ricerca nell'header. */

/* Il wrapper della pagina deve occupare tutta la larghezza disponibile. */
body.page:has(#content input[name="ofpost_types[]"][value="product"]) #content .nm-page-default,
body.page:has(#content input[name="ofpost_types[]"][value="product"]) #content .nm-page-default-col,
body.page:has(#content input[name="ofpost_types[]"][value="product"]) #content .wp-block-columns,
body.page:has(#content input[name="ofpost_types[]"][value="product"]) #content .wp-block-column {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex-basis: 100% !important;
  box-sizing: border-box !important;
}

/* Il selettore riconosce il form prodotti, escludendo quello dei post nel popup. */
body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) {
  display: block !important;
  width: 100% !important;
  max-width: 780px !important;
  margin: 48px auto 70px !important;
  padding: 0 !important;
}

body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) > div > ul {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) > div > ul > li {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) > div > ul > li:first-child {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) input[name="ofsearch"] {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  height: 64px !important;
  margin: 0 !important;
  padding: 8px 0 !important;
  background: #fff !important;
  color: #222 !important;
  border: 0 !important;
  border-bottom: 2px solid #222 !important;
  border-radius: 0 !important;
  font-size: 24px !important;
  line-height: 1.3 !important;
  font-weight: 400 !important;
  box-shadow: none !important;
  outline: none !important;
}

body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) input[name="ofsearch"]::placeholder {
  color: #858585 !important;
  opacity: 1 !important;
}

body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) input[name="ofsearch"]:focus {
  border-bottom-color: #000 !important;
  box-shadow: none !important;
}

/* Pulsante nero circolare con lente bianca, mantenendo l'input submit originale. */
body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) > div > ul > li:last-child {
  position: relative !important;
  flex: 0 0 58px !important;
  width: 58px !important;
  height: 58px !important;
}

body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) input[type="submit"] {
  display: block !important;
  width: 58px !important;
  min-width: 58px !important;
  height: 58px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #111 !important;
  color: transparent !important;
  font-size: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  cursor: pointer !important;
}

body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) > div > ul > li:last-child::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 23px;
  height: 23px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.8' cy='10.8' r='6.8'/%3E%3Cpath d='m16 16 5 5'/%3E%3C/svg%3E");
}

body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) input[type="submit"]:hover {
  background: #333 !important;
}

/* Immagini risultati ricerca prodotti */
body.search-results .ast-blog-layout-4-grid .ast-article-inner .wp-post-image {
    width: 100% !important;
    height: 400px !important;
    object-fit: cover !important;
}

/* Rimuove l'ombra dalle card */
body.search-results .ast-blog-layout-4-grid .ast-article-inner {
    box-shadow: none !important;
}

@media (max-width: 767px) {
  body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) {
    max-width: 100% !important;
    margin: 30px auto 45px !important;
  }
  body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) > div > ul {
    gap: 10px !important;
  }
  body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) input[name="ofsearch"] {
    height: 54px !important;
    font-size: 19px !important;
  }
  body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) > div > ul > li:last-child,
  body.page #content form.searchandfilter:has(input[name="ofpost_types[]"][value="product"]) input[type="submit"] {
    flex-basis: 50px !important;
    width: 50px !important;
    min-width: 50px !important;
    height: 50px !important;
  }
}
