/*
 * PriMa Care - Testata
 * Stile della testata globale: barra, menu desktop con pannello Prodotti, cassetto
 * mobile, fascia dei servizi e ritocchi al carrello nativo di Elementor. Misure,
 * colori e transizioni vengono dal design "Menu e Header" su Claude Design.
 * Soglie: mobile sotto 768 px, tablet da 768 a 1024 px, desktop da 1025 px.
 * Classi con prefisso pc-t-. Le sezioni del template 9576 portano pc-t-barra e pc-t-fascia-sec.
 */

:root {
	--pc-t-alt: 84px;
}

/* ---------- Posizione ---------- */

/* Il contenitore della testata non crea un riquadro: la barra resta fissa (sticky) rispetto alla pagina e la fascia scorre via. */
.elementor-location-header:has(.pc-t-barra) {
	display: contents;
}

body.elementor-editor-active .elementor-location-header:has(.pc-t-barra) {
	display: block;
}

.elementor-location-header .pc-t-barra.elementor-section {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 9999;
	box-sizing: border-box;
	height: var(--pc-t-alt);
	margin: 0;
	padding: 0;
	background: #fff;
	border-bottom: 1px solid #ECE5D9;
	transition: transform .28s cubic-bezier(.2, .7, .2, 1);
}

body.elementor-editor-active .elementor-location-header .pc-t-barra.elementor-section {
	position: relative;
}

/* ---------- Barra: griglia a tre zone ---------- */

.pc-t-barra > .elementor-container {
	display: grid;
	grid-template-columns: 200px minmax(0, 1fr) 200px;
	align-items: center;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	padding: 0 64px;
}

.pc-t-barra > .elementor-container > .elementor-column {
	width: auto;
	min-width: 0;
	max-width: none;
}

.pc-t-barra .elementor-widget-wrap {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	align-content: center;
	padding: 0;
}

.pc-t-barra .elementor-widget-wrap > .elementor-element {
	width: auto;
	margin: 0;
}

.pc-t-barra .pc-t-col-menu .elementor-widget-wrap {
	justify-content: center;
}

.pc-t-barra .pc-t-col-azioni .elementor-widget-wrap {
	justify-content: flex-end;
	gap: 4px;
}

/* Logo: il link è alto 44 px e l'immagine 46 px, come nel design. */
.pc-t-barra .pc-t-logo a {
	display: flex;
	align-items: center;
	height: 44px;
}

.pc-t-barra .pc-t-logo img {
	display: block;
	width: auto;
	max-width: none;
	height: 46px;
}

/* ---------- Testi della testata ---------- */

.pc-t-menu,
.pc-t-fascia {
	font-family: "Inter", system-ui, sans-serif;
	color: #1D1B18;
	-webkit-font-smoothing: antialiased;
}

.pc-t-menu *,
.pc-t-menu *::before,
.pc-t-menu *::after {
	box-sizing: border-box;
}

.pc-t-menu ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pc-t-menu li {
	margin: 0;
	padding: 0;
}

.pc-t-menu a,
.pc-t-menu a:visited {
	color: #1D1B18;
	background: none;
	text-decoration: none;
}

.pc-t-menu a:hover,
.pc-t-menu a:focus-visible {
	color: #6B5A3A;
}

.pc-t-menu a:focus-visible,
.pc-t-ricerca:focus-visible {
	outline: 2px solid #1D1B18;
	outline-offset: 2px;
}

.pc-t-menu svg {
	flex: none;
	display: block;
	stroke-linecap: butt;
}

.pc-t-segnaposto {
	padding: 12px 16px;
	border: 1px dashed #CFC5B4;
	border-radius: 12px;
	font: 400 13px/1.4 "Inter", system-ui, sans-serif;
	color: #57514A;
}

/* ---------- Menu desktop ---------- */

.pc-t-nav__lista {
	display: flex;
	justify-content: center;
	gap: 36px;
}

.pc-t-menu .pc-t-nav__link {
	display: flex;
	align-items: center;
	gap: 6px;
	height: calc(var(--pc-t-alt) - 1px);
	padding: 0;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: .06em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Linea sotto la voce: pagina attiva, oppure pannello aperto. */
.pc-t-menu .pc-t-nav__link[aria-current],
.pc-t-menu .pc-t-nav__link[aria-expanded="true"] {
	box-shadow: inset 0 -2px 0 #1D1B18;
}

.pc-t-nav__link .pc-t-chev {
	width: 12px;
	height: 12px;
	stroke-width: 2;
	transition: transform .2s;
}

.pc-t-nav__link[aria-expanded="true"] .pc-t-chev {
	transform: rotate(180deg);
}

/* Pannello Prodotti: a tutta larghezza sotto la testata, con il velo sul resto della pagina. */
.pc-t-velo,
.pc-t-pannello {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	top: var(--pc-t-top, var(--pc-t-alt));
}

.pc-t-velo {
	bottom: 0;
	z-index: 1;
	background: rgba(29, 27, 24, .32);
}

.pc-t-pannello {
	z-index: 2;
	flex-direction: column;
	gap: 28px;
	padding: 36px 64px 40px;
	background: #fff;
	border-bottom: 1px solid #ECE5D9;
	overflow-y: auto;
	overscroll-behavior: contain;
	max-height: calc(100vh - var(--pc-t-top, var(--pc-t-alt)));
	max-height: calc(100dvh - var(--pc-t-top, var(--pc-t-alt)));
}

.pc-t-menu.is-pannello .pc-t-velo {
	display: block;
}

.pc-t-menu.is-pannello .pc-t-pannello {
	display: flex;
}

.pc-t-pannello__testa {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.pc-t-pannello__titolo {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.pc-t-menu .pc-t-tutti {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	font-size: 16px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.pc-t-tutti .pc-t-freccia {
	width: 16px;
	height: 16px;
}

.pc-t-griglia {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 24px;
}

/* Categorie: le stesse nel pannello e nella fisarmonica. */
.pc-t-menu .pc-t-cat {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.pc-t-cat__img {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 20px;
	/* Nessuno sfondo: le foto hanno gli angoli arrotondati nel file, e dietro si vedrebbe. */
}

.pc-t-cat__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pc-t-cat__testo {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.pc-t-cat__nome {
	font-size: 17px;
	font-weight: 500;
}

.pc-t-cat__nota {
	font-size: 13px;
	color: #57514A;
}

/* Categoria senza prodotti: resta nel menu, spenta e senza link. */
.pc-t-menu .pc-t-cat--presto {
	opacity: .55;
	cursor: default;
}

.pc-t-menu .pc-t-cat--presto:hover {
	color: #1D1B18;
}

/* Pulsante del cassetto, cassetto e fisarmonica: solo mobile. */
.pc-t-btn,
.pc-t-cassetto {
	display: none;
}

/* ---------- Pagina bloccata sotto il menu aperto ---------- */

/*
 * Solo html: un overflow su body lo trasformerebbe in un contenitore di scorrimento
 * e la testata sticky uscirebbe dallo schermo.
 */
html.pc-t-blocca {
	overflow: hidden;
}

/* Solo se la pagina aveva la barra di scorrimento: su una pagina corta il gutter la restringerebbe. */
html.pc-t-blocca--barra {
	scrollbar-gutter: stable;
}

/* ---------- Carrello nativo (woocommerce-menu-cart) ---------- */

.pc-t-barra .pc-t-carrello .elementor-widget-container,
.pc-t-barra .pc-t-carrello .elementor-menu-cart__wrapper,
.pc-t-barra .pc-t-carrello .elementor-menu-cart__toggle_wrapper,
.pc-t-barra .pc-t-carrello .elementor-menu-cart__toggle {
	display: flex;
	margin: 0;
	padding: 0;
}

.pc-t-barra .pc-t-carrello .elementor-menu-cart__toggle_button.elementor-button,
.pc-t-barra .pc-t-carrello .elementor-menu-cart__toggle_button.elementor-button:hover,
.pc-t-barra .pc-t-carrello .elementor-menu-cart__toggle_button.elementor-button:focus {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-width: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #F5F0E8;
	box-shadow: none;
	color: #1D1B18;
}

.pc-t-barra .pc-t-carrello .elementor-menu-cart__toggle_button:focus-visible {
	outline: 2px solid #1D1B18;
	outline-offset: 2px;
}

/* Niente totale accanto all'icona. */
.pc-t-barra .pc-t-carrello .elementor-menu-cart__toggle_button .elementor-button-text {
	display: none;
}

/* Icona del design (borsa, tratto 1.8) su fondo sabbia, al posto di quella di Elementor. */
.pc-t-barra .pc-t-carrello .elementor-button-icon {
	position: static;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin: 0;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231D1B18' stroke-width='1.8'%3E%3Crect x='4' y='8' width='16' height='13' rx='2'/%3E%3Cpath d='M8.5 8V6.5a3.5 3.5 0 0 1 7 0V8'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
}

.pc-t-barra .pc-t-carrello .elementor-button-icon > svg,
.pc-t-barra .pc-t-carrello .elementor-button-icon > i {
	display: none;
}

/* Bollino con il numero: compare solo con almeno un prodotto. */
.pc-t-barra .pc-t-carrello .elementor-menu-cart__toggle .elementor-button-icon .elementor-button-icon-qty[data-counter] {
	position: absolute;
	top: -4px;
	right: -4px;
	bottom: auto;
	left: auto;
	inset-inline-start: auto;
	inset-inline-end: -4px;
	transform: none;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	margin: 0;
	padding: 0 6px;
	box-sizing: border-box;
	border: 0;
	border-radius: 999px;
	background: #1D1B18;
	color: #fff;
	font-family: "Inter", system-ui, sans-serif;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}

.pc-t-barra .pc-t-carrello .elementor-menu-cart__toggle .elementor-button-icon .elementor-button-icon-qty[data-counter="0"] {
	display: none;
}

/* ---------- Ricerca ---------- */

.pc-t-ricerca {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
}

.pc-t-ricerca .pc-t-ico-cerca {
	display: block;
	width: 20px;
	height: 20px;
}

/* ---------- Fascia dei servizi ---------- */

.pc-t-fascia-sec.elementor-section {
	background: #F5F0E8;
}

/* Fuori dalle pagine scelte il widget non stampa nulla: la sezione non occupa spazio. */
.pc-t-fascia-sec:not(:has(.elementor-widget)) {
	display: none;
}

.pc-t-fascia-sec > .elementor-container {
	width: 100%;
	max-width: none;
	padding: 0;
}

.pc-t-fascia-sec .elementor-widget-wrap {
	padding: 0;
}

.pc-t-fascia-sec .elementor-widget {
	margin: 0;
}

.pc-t-fascia {
	overflow: hidden;
	height: 40px;
	font-size: 14px;
	line-height: 1.4;
}

.pc-t-fascia__pista {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
}

.pc-t-fascia__lista {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pc-t-fascia__lista--copia {
	display: none;
}

.pc-t-fascia__voce {
	display: flex;
	margin: 0;
	padding: 0;
	white-space: nowrap;
}

.pc-t-fascia__voce + .pc-t-fascia__voce::before {
	content: "\0000B7";
	margin-right: 28px;
	color: #A39A8C;
}

.pc-t-fascia a,
.pc-t-fascia a:visited {
	color: inherit;
	text-decoration: none;
}

.pc-t-fascia a:hover {
	text-decoration: underline;
}

/* ---------- Home e categorie prodotto: la testata bianca sta sopra il contenuto ---------- */

/*
 * Queste pagine hanno la prima sezione con margine superiore di -100 px: saliva sotto la
 * vecchia testata trasparente. Ora parte sotto la testata, così nulla finisce coperto.
 */
body.home .page-content > [data-elementor-type="wp-page"] > .elementor-section:first-child,
body.tax-product_cat .elementor-location-archive > .elementor-section:first-child {
	margin-top: 0;
}

body.home .page-content > [data-elementor-type="wp-page"] > .elementor-section:first-child {
	min-height: calc(100vh - var(--pc-t-alt));
}

/* ---------- Tablet: da 768 a 1024 px ---------- */

@media (min-width: 768px) and (max-width: 1024px) {
	:root {
		--pc-t-alt: 72px;
	}

	.pc-t-barra > .elementor-container {
		grid-template-columns: auto minmax(0, 1fr) auto;
		padding: 0 32px;
	}

	.pc-t-barra .pc-t-logo img {
		height: 40px;
	}

	.pc-t-nav__lista {
		gap: 24px;
	}

	.pc-t-menu .pc-t-nav__link {
		font-size: 13px;
	}

	.pc-t-pannello {
		gap: 28px;
		padding: 28px 32px 32px;
	}

	.pc-t-griglia {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 20px;
	}

	.pc-t-fascia__lista {
		gap: 20px;
	}

	.pc-t-fascia__voce + .pc-t-fascia__voce::before {
		margin-right: 20px;
	}
}

/* ---------- Mobile: sotto 768 px ---------- */

@media (max-width: 767px) {
	:root {
		--pc-t-alt: 64px;
	}

	/* Si nasconde scorrendo verso il basso e riappare risalendo (testata.js). */
	html.pc-t-nascosta .elementor-location-header .pc-t-barra.elementor-section {
		transform: translateY(calc(-100% - 12px));
	}

	/*
	 * Incavo sotto il logo: la testata resta alta 64 px, il logo cresce del 20% e scende di 7 px
	 * dentro una linguetta bianca che sporge di 11 px. Il bordo segue la curva.
	 */
	.elementor-location-header .pc-t-barra.elementor-section::after {
		content: "";
		position: absolute;
		/* 100% è il bordo interno: l'incavo parte sulla riga del bordo, così le due linee combaciano. */
		top: 100%;
		left: 50%;
		width: 124px;
		height: 12px;
		margin-left: -62px;
		background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 124 12'%3E%3Cpath d='M0 0h124v.5C108 .5 106 11.5 88 11.5H36C18 11.5 16 .5 0 .5z' fill='%23fff'/%3E%3Cpath d='M0 .5C16 .5 18 11.5 36 11.5h52C106 11.5 108 .5 124 .5' fill='none' stroke='%23ECE5D9'/%3E%3C/svg%3E") center / 124px 12px no-repeat;
		pointer-events: none;
		transition: opacity .15s;
	}

	/* Con il menu aperto il cassetto parte dal bordo della testata: l'incavo sparisce. */
	.elementor-location-header .pc-t-barra.elementor-section:has(.pc-t-menu.is-cassetto)::after,
	.elementor-location-header .pc-t-barra.elementor-section:has(.pc-t-cassetto:target)::after {
		opacity: 0;
	}

	.pc-t-barra .pc-t-logo {
		position: relative;
		z-index: 1;
		transform: translateY(7px);
	}

	.pc-t-barra > .elementor-container {
		grid-template-columns: 96px minmax(0, 1fr) 96px;
		padding: 0 8px;
	}

	.pc-t-barra .pc-t-col-menu {
		grid-column: 1;
		grid-row: 1;
	}

	.pc-t-barra .pc-t-col-logo {
		grid-column: 2;
		grid-row: 1;
		justify-self: center;
	}

	.pc-t-barra .pc-t-col-azioni {
		grid-column: 3;
		grid-row: 1;
	}

	.pc-t-barra .pc-t-col-menu .elementor-widget-wrap {
		justify-content: flex-start;
	}

	.pc-t-barra .pc-t-logo img {
		height: 41px;
	}

	.pc-t-nav {
		display: none;
	}

	.pc-t-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
	}

	.pc-t-btn svg {
		width: 22px;
		height: 22px;
	}

	.pc-t-btn .pc-t-ico-chiudi,
	.pc-t-btn[aria-expanded="true"] .pc-t-ico-menu {
		display: none;
	}

	.pc-t-btn[aria-expanded="true"] .pc-t-ico-chiudi {
		display: block;
	}

	/* Cassetto sotto la testata: scorre da sinistra. Chiuso è invisibile, quindi fuori dalla tabulazione. */
	.pc-t-cassetto {
		display: block;
		position: fixed;
		z-index: 1;
		top: var(--pc-t-top, var(--pc-t-alt));
		right: 0;
		left: 0;
		height: calc(100vh - var(--pc-t-top, var(--pc-t-alt)));
		height: calc(100dvh - var(--pc-t-top, var(--pc-t-alt)));
		overflow-y: auto;
		scrollbar-gutter: stable;
		overscroll-behavior: contain;
		background: #fff;
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform .28s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .28s;
	}

	.pc-t-menu.is-cassetto .pc-t-cassetto,
	.pc-t-cassetto:target {
		transform: translateX(0);
		visibility: visible;
		transition: transform .28s cubic-bezier(.2, .7, .2, 1), visibility 0s;
	}

	.pc-t-cassetto nav {
		display: flex;
		flex-direction: column;
	}

	.pc-t-cassetto__cerca {
		padding: 16px 20px 8px;
	}

	.pc-t-menu .pc-t-campo {
		display: flex;
		align-items: center;
		gap: 12px;
		height: 48px;
		padding: 0 18px;
		border-radius: 999px;
		background: #F5F0E8;
		font-size: 15px;
		color: #57514A;
	}

	.pc-t-campo .pc-t-ico-cerca {
		width: 18px;
		height: 18px;
	}

	.pc-t-menu .pc-t-cassetto__lista {
		padding: 0 20px;
	}

	.pc-t-menu .pc-t-voce {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		height: 60px;
		padding: 0;
		border-bottom: 1px solid #ECE5D9;
		font-size: 22px;
		font-weight: 400;
		text-align: left;
	}

	.pc-t-menu .pc-t-voce[aria-current] {
		font-weight: 700;
	}

	.pc-t-voce .pc-t-chev {
		width: 18px;
		height: 18px;
		stroke-width: 1.6;
		transition: transform .2s;
	}

	.pc-t-voce[aria-expanded="true"] .pc-t-chev {
		transform: rotate(180deg);
	}

	.pc-t-acc {
		display: flex;
		flex-direction: column;
		padding: 8px 0 12px;
		border-bottom: 1px solid #ECE5D9;
	}

	.pc-t-acc[hidden] {
		display: none;
	}

	.pc-t-acc .pc-t-cat {
		display: grid;
		grid-template-columns: 44px minmax(0, 1fr) auto;
		align-items: center;
		gap: 14px;
		min-height: 56px;
		font-size: 17px;
	}

	.pc-t-acc .pc-t-cat__img {
		width: 44px;
		height: 44px;
		border-radius: 12px;
	}

	.pc-t-acc .pc-t-cat__testo {
		display: contents;
	}

	.pc-t-acc .pc-t-cat__nome {
		font-size: 17px;
		font-weight: 400;
	}

	.pc-t-acc .pc-t-tutti {
		height: 52px;
		margin-top: 6px;
	}

	/* Senza JavaScript il cassetto si chiude con questo link. Con JavaScript lo fa la X. */
	.pc-t-menu .pc-t-chiudi {
		display: block;
		margin: 16px 20px;
		font-size: 15px;
		text-decoration: underline;
	}

	html.pc-t-js .pc-t-chiudi {
		display: none;
	}

	/* Fascia: tutte le voci in una riga che scorre in cerchio. */
	.pc-t-fascia {
		height: 36px;
		font-size: 13px;
	}

	.pc-t-fascia__pista {
		display: flex;
		justify-content: flex-start;
		width: max-content;
		animation: pc-t-scorri var(--pc-t-durata, 16s) linear infinite;
	}

	.pc-t-fascia__lista {
		flex: none;
		justify-content: flex-start;
		gap: 14px;
		padding-right: 14px;
	}

	.pc-t-fascia__lista--copia {
		display: flex;
	}

	.pc-t-fascia__voce:first-child::before,
	.pc-t-fascia__voce + .pc-t-fascia__voce::before {
		content: "\0000B7";
		margin-right: 14px;
		color: #A39A8C;
	}
}

@keyframes pc-t-scorri {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

/* ---------- Movimento ridotto ---------- */

@media (prefers-reduced-motion: reduce) {
	.pc-t-barra.elementor-section,
	.pc-t-cassetto,
	.pc-t-chev {
		transition: none !important;
	}

	/* La fascia resta ferma: le voci vanno a capo, senza scorrimento orizzontale. */
	.pc-t-fascia__pista {
		animation: none !important;
		width: 100%;
		justify-content: center;
	}

	.pc-t-fascia__lista--copia {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) and (max-width: 767px) {
	.pc-t-fascia {
		height: auto;
		min-height: 36px;
		padding: 6px 12px;
	}

	.pc-t-fascia__pista {
		width: 100%;
		height: auto;
	}

	.pc-t-fascia__lista {
		flex: 1 1 auto;
		min-width: 0;
		flex-wrap: wrap;
		justify-content: center;
		gap: 2px 14px;
		padding-right: 0;
	}

	.pc-t-fascia__voce {
		white-space: normal;
	}

	.pc-t-fascia__voce:first-child::before {
		display: none;
	}
}
