/* ==========================================================================
   TOF – Sito · layout.css  ·  header (.tofh) e footer (.toff)
   Desktop sopra i 1024 px, mobile/tablet fino a 1024 px (come oggi).
   ========================================================================== */

/* ---------- reset locale (il tema stila button, ul, p, a in modo globale) ---------- */
.tofh, .toff { font-family: var(--tof-font); -webkit-font-smoothing: antialiased; }
.tofh *, .toff * { box-sizing: border-box; }
.tofh ul, .toff ul { list-style: none; margin: 0; padding: 0; }
.tofh li, .toff li { margin: 0; padding: 0; }
.tofh p, .toff p { margin: 0; }
.tofh a, .toff a { color: inherit; text-decoration: none; }
.tofh 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: inherit;
	cursor: pointer; line-height: inherit;
}
.tofh [hidden], .toff [hidden] { display: none !important; }
.tofh a:focus-visible, .tofh button:focus-visible, .toff a:focus-visible {
	outline: 2px solid var(--tof-arancio); outline-offset: 3px;
}

/* ================================ HEADER ================================ */

.tofh {
	position: absolute; top: 0; left: 0; right: 0;
	z-index: 1000;
	color: var(--tof-bianco);
}

.tofh__top {
	position: relative; z-index: 4;
	display: flex; align-items: center; justify-content: space-between;
	height: 40px; padding: 0 var(--tof-margine);
	border-bottom: 1px solid var(--tof-linea);
	font-size: 12px; line-height: 1; letter-spacing: .02em; text-transform: uppercase;
}
.tofh__top-dx { display: flex; align-items: center; gap: 28px; }
.tofh__toplink { display: inline-flex; align-items: center; gap: 8px; }
.tofh__toplink .tof-ico { width: 14px; height: 14px; color: var(--tof-arancio); }
.tofh__toplink:hover span { text-decoration: underline; text-underline-offset: 3px; }

.tofh__main {
	position: relative; z-index: 4;
	display: flex; align-items: center; gap: 40px;
	height: 110px; padding: 0 var(--tof-margine);
}
.tofh__logo { flex: none; display: block; line-height: 0; }
.tofh__logo img { width: 110px; height: auto; }
.tofh__logo-c { display: none; }

.tofh__nav { display: flex; align-items: center; gap: 34px; }
.tofh .tofh__voce {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 13px; font-weight: 500; line-height: 1;
	letter-spacing: .03em; text-transform: uppercase; white-space: nowrap;
	padding: 10px 0 !important;
}
.tofh .tofh__voce:hover, .tofh .tofh__voce[aria-expanded="true"] { color: var(--tof-arancio); }
.tofh__piu { width: 12px; height: 12px; transition: transform .25s ease; }
.tofh .tofh__voce[aria-expanded="true"] .tofh__piu,
.tofh .tofh-acc__voce[aria-expanded="true"] .tofh__piu { transform: rotate(45deg); }

.tofh .tofh__cerca { flex: 0 1 340px; margin: 0 auto; min-width: 0; }
.tofh__nav--azienda { gap: 36px; }

/* pulsanti solo mobile */
.tofh .tofh__btn-cerca, .tofh .tofh__btn-menu { display: none; }

/* ---------- pulsante ricerca nell'header (apre il pannello) ---------- */
.tofh .tofh__cerca {
	display: flex; align-items: center; gap: 12px;
	height: 48px; padding: 0 10px 0 18px !important;
	border-radius: var(--tof-pill) !important;
	background: rgba(255, 255, 255, .12) !important;
	border: 1px solid rgba(255, 255, 255, .28) !important;
	color: rgba(255, 255, 255, .85);
	font-size: 14px; text-align: left;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	transition: background .2s ease, border-color .2s ease;
}
.tofh .tofh__cerca:hover { background: rgba(255, 255, 255, .2) !important; border-color: rgba(255, 255, 255, .5) !important; }
.tofh__cerca .tof-ico { width: 18px; height: 18px; flex: none; }
.tofh__cerca-testo { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tofh__cerca-tasto {
	flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px;
	border: 1px solid rgba(255, 255, 255, .35); border-radius: 6px;
	font: 400 12px/1 var(--tof-mono); color: inherit; background: none;
}
.tofh--chiaro .tofh__cerca { background: var(--tof-lavanda) !important; border-color: transparent !important; color: var(--tof-viola); }
.tofh--chiaro .tofh__cerca-tasto { border-color: rgba(47, 28, 123, .3); }

/* ---------- pannelli del mega menu ---------- */
.tofh-pannello {
	position: absolute; z-index: 5;
	top: 150px; left: 50%; transform: translateX(-50%);
	width: min(1140px, calc(100% - 2 * var(--tof-margine)));
	background: var(--tof-bianco); color: var(--tof-viola);
	box-shadow: 0 30px 80px rgba(27, 12, 65, .35);
	animation: tofh-apri .22s ease-out;
}
@keyframes tofh-apri { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.tofh-pannello__testa {
	display: flex; align-items: center; justify-content: space-between;
	padding: 14px 28px; background: var(--tof-viola);
}
.tofh-pannello__titolo { color: var(--tof-arancio); font-size: 22px; font-weight: 500; line-height: 1.2; }
.tofh .tofh-pannello__chiudi { color: var(--tof-arancio); line-height: 0 !important; }
.tofh .tofh-pannello__chiudi .tof-ico { width: 24px; height: 24px; }

.tofh-pannello__corpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); min-height: 380px; }
.tofh-pannello__lista { padding: 34px 28px 30px; }
.tofh-pannello__lista li a { display: block; padding: 4px 0; font-size: 17px; line-height: 1.4; }
.tofh-pannello__lista li a:hover { color: var(--tof-arancio); }
.tofh-pannello__tutti {
	display: inline-flex; align-items: center; gap: 6px; margin-top: 22px;
	color: var(--tof-arancio) !important; font-size: 13px;
	text-decoration: underline !important; text-underline-offset: 3px;
}
.tofh-pannello__tutti .tof-ico { width: 12px; height: 12px; }

.tofh-pannello__card {
	position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
	padding: 34px 28px; overflow: hidden; color: var(--tof-bianco) !important; isolation: isolate;
}
.tofh-pannello__card img {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
	transition: transform .6s ease;
}
.tofh-pannello__card::after {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(180deg, rgba(27, 12, 65, .55) 0%, rgba(27, 12, 65, .05) 55%, rgba(27, 12, 65, .35) 100%);
}
.tofh-pannello__card:hover img { transform: scale(1.04); }
.tofh-pannello__card-titolo { max-width: 360px; font-size: 34px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }

.tofh__velo { position: fixed; inset: 0; z-index: 1; background: var(--tof-velo); }

/* menu a tutto schermo: solo mobile */
.tofh-menu { display: none; }

/* ---------- header chiaro (contatti, schede prodotto) ---------- */
.tofh--chiaro { background: var(--tof-bianco); color: var(--tof-viola); }
.tofh--chiaro .tofh__top { border-bottom-color: rgba(47, 28, 123, .35); }
.tofh--chiaro .tofh__logo-b { display: none; }
.tofh--chiaro .tofh__logo-c { display: block; }

/* ================================ FOOTER ================================ */

.toff {
	position: relative;
	background: var(--tof-viola); color: var(--tof-bianco);
	padding: 64px var(--tof-margine) 28px;
}
.toff__alto { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.toff__marca img { width: 150px; height: auto; display: block; }
.toff__marca p { max-width: 470px; margin-top: 22px; font-size: 16px; line-height: 1.6; }
.toff__slash { width: 233px; height: auto; flex: none; }

.toff__colonne {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px;
	margin-top: 64px;
}
.toff__col li { font-size: 14px; line-height: 1.5; }
.toff__col li + li { margin-top: 8px; }
.toff__col a:hover { text-decoration: underline; text-underline-offset: 3px; }

.toff__basso {
	display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
	margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--tof-linea);
	font-size: 12px; line-height: 1.6; color: rgba(255, 255, 255, .8);
}
.toff__basso a:hover { color: var(--tof-bianco); text-decoration: underline; }

/* ======================= MOBILE E TABLET (≤ 1024 px) ======================= */
@media (max-width: 1024px) {

	.tofh__top { height: 40px; padding: 0 var(--tof-margine-m); font-size: 11px; justify-content: flex-end; }
	.tofh__tel { display: none; }
	.tofh__top-dx { gap: 20px; }

	.tofh__main { height: 76px; padding: 0 var(--tof-margine-m); gap: 12px; }
	.tofh__logo img { width: 92px; }
	.tofh__nav, .tofh .tofh__cerca { display: none; }

	.tofh .tofh__btn-cerca {
		display: inline-flex; align-items: center; justify-content: center;
		width: 44px; height: 44px; margin-left: auto;
	}
	.tofh .tofh__btn-cerca .tof-ico { width: 22px; height: 22px; }
	.tofh .tofh__btn-menu {
		display: inline-flex; align-items: center;
		height: 40px; padding: 0 18px !important;
		border-radius: 6px !important;
		background: var(--tof-bianco) !important; color: var(--tof-notte) !important;
		font-size: 13px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
	}


	.tofh-pannello, .tofh__velo { display: none !important; }

	/* header chiaro su mobile = fondo viola (come oggi) */
	.tofh--chiaro { background: var(--tof-viola); color: var(--tof-bianco); }
	.tofh--chiaro .tofh__top { border-bottom-color: var(--tof-linea); }
	.tofh--chiaro .tofh__logo-b { display: block; }
	.tofh--chiaro .tofh__logo-c { display: none; }

	/* ---- menu a tutto schermo ---- */
	.tofh-menu {
		display: block;
		position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 20;
		overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
		background: var(--tof-viola); color: var(--tof-bianco);
		padding: calc(28px + env(safe-area-inset-top)) var(--tof-margine-m) calc(120px + env(safe-area-inset-bottom));
	}
	.tofh-menu[hidden] { display: none !important; }

	.tofh-acc { border-bottom: 1px solid var(--tof-linea); }
	.tofh .tofh-acc__voce {
		display: flex !important; width: 100%; align-items: center; justify-content: space-between;
		padding: 16px 0 !important; font-size: 30px; font-weight: 400; line-height: 1.1; letter-spacing: -.01em;
	}
	.tofh .tofh-acc__voce .tofh__piu { width: 22px; height: 22px; }
	.tofh-acc__corpo { padding: 0 0 20px; }
	.tofh-acc__corpo li a { display: block; padding: 7px 0; font-size: 17px; line-height: 1.35; color: rgba(255, 255, 255, .88); }
	.tofh-acc__corpo .tofh-pannello__tutti { margin-top: 12px; font-size: 15px; }

	.tofh-menu__label2 { margin-top: 36px !important; }
	.tofh-menu__azienda li a { display: block; padding: 6px 0; font-size: 28px; line-height: 1.2; }

	.tofh-menu__servizio { margin-top: 36px !important; padding-top: 24px !important; border-top: 1px solid var(--tof-linea); }
	.tofh-menu__servizio li a { display: inline-flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 15px; }
	.tofh-menu__servizio .tof-ico { width: 16px; height: 16px; color: var(--tof-arancio); }

	.tofh .tofh-menu__chiudi {
		position: fixed !important; z-index: 21;
		left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
		display: inline-flex !important; align-items: center; gap: 10px;
		padding: 14px 26px !important; border-radius: var(--tof-pill) !important;
		background: var(--tof-bianco) !important; color: var(--tof-viola) !important;
		font-size: 15px; font-weight: 500;
		box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
	}
	.tofh .tofh-menu__chiudi .tof-ico { width: 16px; height: 16px; }

	/* ---- footer ---- */
	.toff { padding: 56px var(--tof-margine-m) 28px; }
	.toff__slash { display: none; }
	.toff__marca img { width: 120px; }
	.toff__marca p { font-size: 15px; margin-top: 18px; }
	.toff__colonne { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 20px; margin-top: 44px; }
	.toff__basso { margin-top: 40px; font-size: 12px; }
}

/* etichette: il reset dei paragrafi non deve togliere lo spazio sotto */
.tofh .tof-label, .toff .tof-label { margin: 0 0 14px; }
.tofh .tofh-menu .tof-label { margin-bottom: 6px; }
