/* ==========================================================================
   TOF – Sito · ricerca.css  ·  pannello di ricerca (.tofr)
   ========================================================================== */

.tofr { position: fixed; inset: 0; z-index: 100; font-family: var(--tof-font); color: var(--tof-notte); }
.tofr[hidden] { display: none !important; }
.tofr *, .tofr *::before, .tofr *::after { box-sizing: border-box; }
.tofr p { margin: 0; }
.tofr a { text-decoration: none; color: inherit; }
.tofr button {
	-webkit-appearance: none; appearance: none; margin: 0; padding: 0; border: 0; border-radius: 0;
	background: none; box-shadow: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: none; cursor: pointer;
}
.tofr kbd {
	display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px;
	border: 1px solid rgba(27, 12, 65, .2); border-radius: 5px; background: var(--tof-bianco);
	font: 400 11px/1 var(--tof-mono); color: var(--tof-notte); box-shadow: 0 1px 0 rgba(27, 12, 65, .15);
}

.tofr__velo {
	position: absolute; inset: 0;
	background: rgba(27, 12, 65, .62);
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
	animation: tofr-velo .2s ease-out;
}
@keyframes tofr-velo { from { opacity: 0; } to { opacity: 1; } }

.tofr__box {
	position: relative;
	display: flex; flex-direction: column;
	width: min(860px, calc(100% - 60px));
	max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px);
	margin: 96px auto 0;
	background: var(--tof-bianco);
	box-shadow: 0 40px 100px rgba(10, 4, 30, .45);
	animation: tofr-box .24s cubic-bezier(.2, .8, .2, 1);
}
@keyframes tofr-box { from { opacity: 0; transform: translateY(-12px) scale(.985); } to { opacity: 1; transform: none; } }

/* campo */
.tofr__campo { position: relative; display: flex; align-items: center; gap: 14px; padding: 0 22px 0 26px; border-bottom: 1px solid #E3E1EC; }
.tofr__lente { width: 24px !important; height: 24px !important; color: var(--tof-arancio); }
.tofr .tofr__input {
	flex: 1; min-width: 0; height: 76px; margin: 0; padding: 0;
	border: 0 !important; outline: none !important; background: none !important; box-shadow: none !important;
	font: 400 26px/1.2 var(--tof-font) !important; color: var(--tof-notte) !important; letter-spacing: -.01em;
}
.tofr__input::placeholder { color: rgba(27, 12, 65, .35); }
.tofr__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.tofr .tofr__chiudi { display: inline-flex; align-items: center; gap: 8px; color: rgba(27, 12, 65, .55); }
.tofr .tofr__chiudi:hover { color: var(--tof-viola); }
.tofr__chiudi .tof-ico { display: none; width: 22px; height: 22px; }
.tofr__esc { font: 400 11px/1 var(--tof-mono); padding: 6px 7px; border: 1px solid rgba(27, 12, 65, .2); border-radius: 5px; }

/* filtri per settore */
.tofr__filtri { display: flex; gap: 8px; padding: 14px 26px; border-bottom: 1px solid #E3E1EC; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.tofr__filtri::-webkit-scrollbar { display: none; }
.tofr .tofr-filtro {
	flex: none; padding: 8px 14px; border: 1px solid #D9D6E6; border-radius: var(--tof-pill);
	font-size: 13px; line-height: 1; color: var(--tof-viola); white-space: nowrap;
	transition: background .15s, color .15s, border-color .15s;
}
@media (hover: hover) { .tofr .tofr-filtro:hover { border-color: var(--tof-viola); } }
.tofr .tofr-filtro[aria-pressed="true"] { background: var(--tof-viola); border-color: var(--tof-viola); color: var(--tof-bianco); }

/* corpo con i risultati */
.tofr__corpo { flex: 1; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; padding: 8px 14px 18px; }
.tofr__sez { padding: 16px 12px 4px; }
.tofr__sez + .tofr__sez { border-top: 1px solid #EEECF4; margin-top: 8px; }
.tofr .tof-label { margin: 0 0 10px; }
.tofr__sez-testa { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tofr__conta { font: 400 12px/1 var(--tof-mono); color: rgba(27, 12, 65, .5); }
.tofr .tofr__cancella { font-size: 12px; color: rgba(27, 12, 65, .55); text-decoration: underline; text-underline-offset: 3px; }

.tofr__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tofr .tofr-chip {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 9px 14px; border-radius: var(--tof-pill); background: var(--tof-lavanda);
	font-size: 14px; line-height: 1; color: var(--tof-viola);
	transition: background .15s, color .15s;
}
.tofr .tofr-chip .tof-ico { width: 13px; height: 13px; opacity: .7; }
.tofr .tofr-chip:hover, .tofr .tofr-chip[aria-selected="true"] { background: var(--tof-viola); color: var(--tof-bianco); }
.tofr__consiglio { padding: 18px 12px 4px; font-size: 13px; color: rgba(27, 12, 65, .55); }

/* categorie */
.tofr__cat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tofr-c {
	display: flex; align-items: center; gap: 10px; padding: 12px 14px;
	background: #F6F6FB; font-size: 15px; color: var(--tof-viola);
}
.tofr-c > span:first-child { flex: 1; min-width: 0; }
.tofr-c__n { font: 400 11px/1 var(--tof-mono); text-transform: uppercase; color: rgba(27, 12, 65, .5); }
.tofr-c .tof-ico { width: 13px; height: 13px; color: var(--tof-arancio); }
.tofr-c:hover, .tofr-c[aria-selected="true"] { background: var(--tof-lavanda); }

/* prodotti */
.tofr-p {
	display: flex; align-items: center; gap: 14px; padding: 8px 10px; margin: 0 -10px;
	transition: background .12s;
}
.tofr-p + .tofr-p { border-top: 1px solid #F1F0F6; }
.tofr-p:hover, .tofr-p[aria-selected="true"] { background: #F4F3FA; }
.tofr-p__img { flex: none; width: 56px; height: 56px; background: #F6F6FB; display: grid; place-items: center; overflow: hidden; }
.tofr-p__img img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.tofr-p__testo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tofr-p__nome { font-size: 16px; line-height: 1.25; color: var(--tof-notte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tofr-p__meta { font-size: 12.5px; line-height: 1.2; color: rgba(27, 12, 65, .58); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tofr-p__sku { font-family: var(--tof-mono); color: var(--tof-viola); letter-spacing: .02em; }
.tofr-p__sku.is-trovato { color: var(--tof-arancio); font-weight: 500; }
.tofr-sep { margin: 0 7px; opacity: .5; }
.tofr-p__freccia { flex: none; color: var(--tof-arancio); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.tofr-p__freccia .tof-ico { width: 15px; height: 15px; }
.tofr-p:hover .tofr-p__freccia, .tofr-p[aria-selected="true"] .tofr-p__freccia { opacity: 1; transform: none; }
.tofr mark { background: none; color: var(--tof-arancio); font-weight: 500; padding: 0; }

.tofr .tofr__tutti {
	display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 4px;
	font-size: 14px; font-weight: 500; color: var(--tof-viola);
	text-decoration: underline; text-underline-offset: 4px;
}
.tofr__tutti .tof-ico { width: 13px; height: 13px; color: var(--tof-arancio); }
.tofr__tutti[aria-selected="true"] { color: var(--tof-arancio); }

/* nessun risultato e invito al custom */
.tofr__vuoto { padding: 26px 12px 8px; }
.tofr__vuoto-titolo { font-size: 20px; line-height: 1.3; color: var(--tof-viola); margin-bottom: 6px !important; }
.tofr__vuoto > p:not(.tofr__vuoto-titolo) { font-size: 14px; color: rgba(27, 12, 65, .6); margin-bottom: 16px !important; }
.tofr__custom {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	margin: 18px 12px 4px; padding: 16px 18px; background: var(--tof-viola); color: var(--tof-bianco); font-size: 14px; line-height: 1.4;
}
.tofr__custom-link { display: inline-flex; align-items: center; gap: 16px; }
.tofr .tofr__link { color: var(--tof-bianco); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.tofr .tof-pill { padding: 10px 16px; font-size: 13px; }

/* stato di caricamento */
.tofr__stato { display: flex; align-items: center; gap: 10px; padding: 28px 12px; font-size: 14px; color: rgba(27, 12, 65, .6); }
.tofr__rotella { width: 16px; height: 16px; border: 2px solid #E0DDEB; border-top-color: var(--tof-arancio); border-radius: 50%; animation: tofr-giro .7s linear infinite; }
@keyframes tofr-giro { to { transform: rotate(360deg); } }

/* piede con i tasti */
.tofr__piede {
	display: flex; gap: 22px; padding: 12px 26px; border-top: 1px solid #E3E1EC; background: #FAFAFD;
	font-size: 12px; color: rgba(27, 12, 65, .55);
}
.tofr__piede span { display: inline-flex; align-items: center; gap: 4px; }

/* ======================= MOBILE E TABLET (≤ 1024 px) ======================= */
@media (max-width: 1024px) {
	.tofr__velo { display: none; }
	.tofr__box {
		position: absolute; top: 0; bottom: 0; left: 0; right: 0;
		width: 100%; max-height: none; margin: 0;
		padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
		box-shadow: none; animation: tofr-velo .15s ease-out;
	}
	.tofr__campo { padding: 0 8px 0 20px; gap: 10px; }
	.tofr .tofr__input { height: 64px; font-size: 19px !important; }
	.tofr__lente { width: 20px !important; height: 20px !important; }
	.tofr__esc { display: none; }
	.tofr .tofr__chiudi { width: 44px; height: 44px; justify-content: center; color: var(--tof-viola); }
	.tofr__chiudi .tof-ico { display: block; }
	.tofr__filtri { padding: 12px 20px; }
	.tofr__corpo { padding: 4px 8px 28px; }
	.tofr__cat { grid-template-columns: minmax(0, 1fr); }
	.tofr-p__nome { font-size: 15px; white-space: normal; }
	.tofr-p__meta { white-space: normal; }
	.tofr-p__freccia { display: none; }
	.tofr__custom { flex-direction: column; align-items: flex-start; }
	.tofr__piede { display: none; }
}
