/* =====================================================================
   RICERCA (pacchetto 2) — stessa linea di prima: tutto bianco, nero per testo e linee, niente ombre pesanti.
   Livello: 10050 (sopra testata e pannello menu, sotto il loader).
   ===================================================================== */

.sf-ricerca {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: #fff;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transition: opacity .2s ease;
}
.sf-ricerca[hidden] { display: none; }
.sf-ricerca.is-aperta { opacity: 1; }
html.sf-ricerca-aperta,
html.sf-ricerca-aperta body { overflow: hidden; }

.sf-ricerca__box {
    max-width: 920px;
    margin: 0 auto;
    padding: 56px 32px 48px;
    box-sizing: border-box;
}

/* ---------------------------------------------------------------- campo */
.sf-ricerca__form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid #000;
    margin: 0;
}
.sf-ricerca__lente { font-size: 20px; color: #000; flex: 0 0 auto; }
.sf-ricerca .sf-ricerca__campo {
    flex: 1 1 auto;
    min-width: 0;
    height: 64px;
    padding: 0;
    margin: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent;
    box-shadow: none !important;
    outline: none;
    color: #000;
    font: inherit;
    font-size: 26px;           /* mai sotto 16 px: su iPhone eviterebbe lo zoom automatico */
    letter-spacing: .2px;
    -webkit-appearance: none;
    appearance: none;
}
.sf-ricerca__campo::placeholder { color: #9a9a9a; opacity: 1; }
.sf-ricerca__campo::-webkit-search-cancel-button,
.sf-ricerca__campo::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.sf-ricerca__svuota,
.sf-ricerca__chiudi {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 6px;
    background: none;
    border: 0;
    color: #000;
    font: inherit;
    cursor: pointer;
}
.sf-ricerca__svuota { font-size: 18px; color: #777; }
.sf-ricerca__svuota[hidden] { display: none; }
.sf-ricerca__chiudi {
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-left: 1px solid #e5e5e5;
    padding-left: 14px;
    margin-left: 2px;
}
.sf-ricerca__svuota:hover { color: #000; }
.sf-ricerca__chiudi:hover { text-decoration: underline; text-underline-offset: 4px; }
.sf-ricerca__svuota:focus-visible,
.sf-ricerca__chiudi:focus-visible,
.sf-ricerca a:focus-visible,
.sf-ricerca button:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

/* ---------------------------------------------------------------- corpo */
.sf-ricerca__corpo { padding-top: 20px; }
.sf-ricerca__stato {
    min-height: 20px;
    margin: 0 0 12px;
    color: #6b6b6b;
    font-size: 14px;
    line-height: 20px;
}
.sf-ricerca__stato:empty { margin-bottom: 0; }

.sf-ricerca h3 {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #000;
}
.sf-ricerca__intestazione { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sf-ricerca__cancella-recenti {
    background: none;
    border: 0;
    padding: 6px 0;
    color: #6b6b6b;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.sf-ricerca__iniziale section + section { margin-top: 28px; }

/* pastiglie (ricerche recenti, collezioni) */
.sf-ricerca__chip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.sf-ricerca__chip li { margin: 0; }
.sf-ricerca__chip a,
.sf-ricerca__chip button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    background: #fff;
    color: #000;
    font: inherit;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s ease;
}
.sf-ricerca__chip a:hover,
.sf-ricerca__chip button:hover { border-color: #000; }
.sf-ricerca__chip .sf-ricerca__n { margin-left: 6px; color: #8a8a8a; font-size: 12px; }

.sf-ricerca__collezioni-trovate { margin-bottom: 20px; }
.sf-ricerca__collezioni-trovate[hidden] { display: none; }

/* elenco prodotti */
.sf-ricerca__risultati {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sf-ricerca__risultati:empty { display: none; }
.sf-ricerca__voce { margin: 0; border-bottom: 1px solid #f0f0f0; }
.sf-ricerca__voce a {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 16px;
    padding: 10px 8px;
    color: #000;
    text-decoration: none;
}
.sf-ricerca__voce img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: cover;
    background: #f6f6f6;
}
.sf-ricerca__voce.is-attiva a,
.sf-ricerca__voce a:hover { background: #f7f7f7; transform: none; opacity: 1; } /* niente salto di 1 px del tema */
.sf-ricerca__titolo { display: block; font-size: 16px; line-height: 1.3; }
.sf-ricerca__titolo mark { background: none; color: inherit; font-weight: 600; padding: 0; }
.sf-ricerca__meta { display: block; margin-top: 3px; color: #7a7a7a; font-size: 13px; line-height: 1.3; }
.sf-ricerca__prezzo { font-size: 15px; text-align: right; white-space: nowrap; }
.sf-ricerca__prezzo del { color: #9a9a9a; margin-right: 6px; }
.sf-ricerca__prezzo ins { text-decoration: none; }
/* targhette (saldo, esaurito): stesso disegno del negozio (css/woocommerce.css), in piccolo accanto alla categoria */
.sf-ricerca__targhette { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.sf-ricerca__categoria + .sf-ricerca__targhette { margin-left: 8px; }
.sf-ricerca .sf-targhetta { min-width: 0; min-height: 14px; padding: 2px 6px; font-size: 10px; line-height: 14px; box-shadow: none; }

.sf-ricerca__tutti { margin: 18px 0 0; }
.sf-ricerca__tutti[hidden] { display: none; }
.sf-ricerca__tutti a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #000;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 5px;
}

/* caricamento: una riga sottile sotto al campo, nessuno spinner */
.sf-ricerca__form::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 0;
    background: #9a9a9a;
}
.sf-ricerca.is-in-corso .sf-ricerca__form::after { animation: sf-ricerca-barra 1s ease-in-out infinite; }
@keyframes sf-ricerca-barra {
    0% { left: 0; width: 0; }
    50% { left: 0; width: 60%; }
    100% { left: 100%; width: 0; }
}

/* ---------------------------------------------------------------- telefono */
@media (max-width: 767px) {
    .sf-ricerca__box { padding: 12px 16px 32px; }
    .sf-ricerca .sf-ricerca__campo { height: 56px; font-size: 18px; }
    .sf-ricerca__lente { font-size: 16px; }
    .sf-ricerca__chiudi { padding-left: 10px; font-size: 12px; }
    .sf-ricerca__voce a { grid-template-columns: 56px minmax(0, 1fr); row-gap: 4px; padding: 10px 4px; }
    .sf-ricerca__voce img { width: 56px; height: 56px; grid-row: span 2; }
    .sf-ricerca__prezzo { grid-column: 2; text-align: left; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .sf-ricerca { transition: none; }
    .sf-ricerca.is-in-corso .sf-ricerca__form::after { animation: none; width: 100%; }
}
