/* ═══════════ RICERCA PRODOTTI ═══════════ */
html:has(.ma-search[open]) { overflow: hidden; }
.ma-search:not([open]) { display: none !important; }
.ma-search {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0;     background: rgba(0, 0, 0, 0.5); color: #fff; overflow-y: auto;
}
.ma-search::backdrop { background: rgba(30, 10, 14, .45); }
.ma-search[open] { animation: ma-search-in .35s ease both; }
@keyframes ma-search-in { from { opacity: 0; transform: translateY(-14px); } }

/* Barra */
.ma-search__bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: flex-end; gap: 28px;
  max-width: 1200px; margin: 0 auto; padding: 200px 40px 0; }
.ma-search__form {
  position: relative; flex: 1; display: flex; align-items: center; gap: 18px; margin: 0;
  padding: 0 0 16px; border-bottom: 1.5px solid rgba(163, 32, 53, .25); transition: border-color .3s;
}
.ma-search__form:focus-within { border-bottom-color: #fff; }
.ma-search__icon { flex: 0 0 24px; width: 24px; height: 24px; }
.ma-search__input {
  flex: 1; min-width: 0; margin: 0; padding: 0 !important; border: 0 !important; outline: 0; background: none !important; box-shadow: none !important;
  font: inherit; font-size: 18px !important; font-weight: 300; color: #fff !important;
}
.ma-search__input::placeholder { color: #fff; }
.ma-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Caricamento: linea che scorre sotto il campo */
.ma-search__form::after {
  content: ""; position: absolute; left: 0; bottom: -1.5px; width: 30%; height: 1.5px;
  background: var(--main-color); opacity: 0;
}
.ma-search.is-loading .ma-search__form::after { opacity: 1; animation: ma-search-load 1s ease-in-out infinite; }
@keyframes ma-search-load { from { left: -30%; } to { left: 100%; } }

/* Chiudi */
.ma-search__close {
  position: relative; flex: 0 0 32px; width: 32px; height: 32px; margin: 0 0 20px; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 0; color: #fff;
}
.ma-search__close::before,
.ma-search__close::after {
  content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 1.5px;
  background: currentColor; transform: rotate(45deg); transition: transform .3s;
}
.ma-search__close::after { transform: rotate(-45deg); }
.ma-search__close:hover::before { transform: rotate(135deg); }
.ma-search__close:hover::after  { transform: rotate(45deg); }

/* Risultati */
.ma-search__body { max-width: 1200px; margin: 0 auto; background-color: #fff;    border-radius: 5px; margin-top: 30px;}
.ma-search__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 24px;  padding: 44px 40px 64px;
  margin: 0;  list-style: none;
}
.ma-search__grid li { margin: 0; padding: 0; animation: ma-search-item .4s ease both; }
.ma-search__grid li:nth-child(2) { animation-delay: .04s; }
.ma-search__grid li:nth-child(3) { animation-delay: .08s; }
.ma-search__grid li:nth-child(4) { animation-delay: .12s; }
.ma-search__grid li:nth-child(n+5) { animation-delay: .16s; }
@keyframes ma-search-item { from { opacity: 0; transform: translateY(8px); } }

.ma-search__item { display: block; color: var(--main-color) !important; text-decoration: none !important; }
.ma-search__img {
  display: block; aspect-ratio: 1; padding: 12%; box-sizing: border-box; overflow: hidden; background: #f3f1f2;
}
.ma-search__img img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .5s ease; }
.ma-search__item:hover .ma-search__img img { transform: scale(1.05); }
.ma-search__name {
  display: block; margin: 16px 0 6px;
  font-size: 12px; font-weight: 400; line-height: 1.4; text-transform: uppercase;
}
.ma-search__price { display: block; font-size: 14px; }
.ma-search__price :is(.amount, bdi) { color: inherit !important; font: inherit !important; }
.ma-search__price del { margin-right: 6px; opacity: .5; }
.ma-search__price ins { text-decoration: none; }

/* Vedi tutti */
.ma-search__all {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: max-content; margin: 48px auto 0;
  font-size: 12px; font-weight: 600;  text-transform: uppercase;
  color: var(--main-color) !important; text-decoration: none !important;
}
.ma-search__all::after {
  content: ""; width: 7px; height: 10px; background: currentColor;
  -webkit-mask: var(--chevron) center / contain no-repeat; mask: var(--chevron) center / contain no-repeat;
  transition: translate .3s;
}
.ma-search__all:hover::after { translate: 4px 0; }

/* Nessun risultato */
.ma-search__empty { margin: 20px 0 0; text-align: center; font-size: 15px; color: var(--main-color); }

@media (max-width: 900px) {
  .ma-search__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .ma-search__bar { gap: 16px; padding: 108px 20px 0; }
  .ma-search__body { padding: 28px 20px 48px; }
  .ma-search__grid { grid-template-columns: repeat(2, 1fr); gap: 28px 14px; }
  .ma-search__icon { flex-basis: 20px; width: 20px; height: 20px; }
}