/* =========================================================
   Paviterra — Header
   ========================================================= */

:root {
	--pv-rust: #ba4307;
	--pv-rust-dark: #97350a;
	--pv-ink: #474746;
	--pv-sand: #e8cbb4;
	--pv-muted: #aaaaaa;
	--pv-line: #ececec;
	--pv-bg: #ffffff;
	--pv-header-h: 92px;
	--pv-radius: 22px;
	--pv-shadow: 0 12px 30px -8px rgba(23, 23, 23, .14), 0 4px 12px rgba(23, 23, 23, .06);
}

/* ---------- Barre ---------- */
.pv-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--pv-bg);
	border-bottom: 1px solid transparent;
	transition: box-shadow .3s ease, border-color .3s ease;
}
.pv-header.is-stuck {
	border-bottom-color: var(--pv-line);
	box-shadow: 0 10px 30px -22px rgba(23, 23, 23, .35);
}
.pv-header__inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: 1600px;
	margin: 0 auto;
	padding: 0 40px;
	height: var(--pv-header-h);
}

/* ---------- Logo ---------- */
.pv-logo {
	position: relative;
	z-index: 6;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	flex: 0 0 auto;
}
.pv-logo img { display: block; height: auto; }
.pv-logo__word {
	font-weight: 700;
	font-size: 30px;
	letter-spacing: .5px;
	line-height: 1;
	font-family: var(--pv-font);
}
.pv-logo__pavi  { color: var(--pv-ink); }
.pv-logo__terra { color: var(--pv-rust); }
.pv-logo__mark {
	width: 34px; height: 34px;
	border-radius: 7px;
	background: linear-gradient(135deg, var(--pv-sand) 0 50%, var(--pv-ink) 50% 100%);
	position: relative;
	display: inline-block;
}
.pv-logo__tile {
	position: absolute;
	left: 50%; top: 50%;
	width: 9px; height: 9px;
	transform: translate(-50%, -50%);
	background: var(--pv-rust);
	border-radius: 50%;
}

/* ---------- Nav : carte unique (liens + méga-menus) ---------- */
.pv-nav {
	position: absolute;
	left: 50%;
	top: 16px;
	transform: translateX(-50%);
	width: 620px;
	max-width: calc(100vw - 90px);
	background: #fff;
	border-radius: 999px;
	box-shadow: var(--pv-shadow);
	z-index: 5;
	transition: width .38s cubic-bezier(.4, 0, .2, 1),
		border-radius .3s ease, box-shadow .3s ease;
}
.pv-nav.is-open {
	width: min(1120px, calc(100vw - 64px));
	border-radius: 26px;
	box-shadow: 0 34px 70px -34px rgba(23, 23, 23, .38), 0 8px 22px rgba(23, 23, 23, .08);
}
.pv-nav__list {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 48px;
	margin: 0;
	padding: 16px 40px;
	list-style: none;
}
.pv-nav__item { position: relative; }
.pv-nav__link {
	display: inline-block;
	text-decoration: none;
	color: var(--pv-ink);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	transition: color .2s ease;
}
.pv-nav__link:hover,
.pv-nav__link.is-active { color: var(--pv-rust); }

/* ---------- Panneaux méga (dans la carte) ---------- */
.pv-nav__panels {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	transition: grid-template-rows .42s cubic-bezier(.4, 0, .2, 1), opacity .3s ease;
}
.pv-nav.is-open .pv-nav__panels {
	grid-template-rows: 1fr;
	opacity: 1;
}
.pv-nav__panels > .pv-mega { min-height: 0; overflow: hidden; }
.pv-mega {
	position: relative;
	padding: 6px 60px 44px;
}
.pv-mega[hidden] { display: none; }
.pv-mega__surtitre {
	position: absolute;
	left: 20px;
	top: 6px;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	color: #d4d4d4;
	font-weight: 700;
	font-size: 20px;
	letter-spacing: 1px;
	line-height: 1.3;
	white-space: normal;
	max-height: 142px;
	text-align: right;
}
.pv-mega__cols {
	display: flex;
	justify-content: center;
	gap: 40px;
	padding: 0 30px 0 44px;
}
.pv-mega__col { flex: 0 1 200px; min-width: 0; }
.pv-mega__titre {
	display: block;
	font-size: 22px;
	font-weight: 800;
	color: var(--pv-ink);
	text-decoration: none;
	margin-bottom: 18px;
}
a.pv-mega__titre:hover { color: var(--pv-rust); }
.pv-mega__links { list-style: none; margin: 0; padding: 0; }
.pv-mega__links li { margin-bottom: 12px; }
.pv-mega__links a {
	text-decoration: none;
	color: var(--pv-muted);
	font-size: 16px;
	transition: color .18s ease;
}
.pv-mega__links a:hover { color: var(--pv-rust); }

/* Réseaux sociaux (colonne de droite) */
.pv-mega__socials {
	position: absolute;
	right: 26px;
	top: 10px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.pv-social {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 1.5px solid var(--pv-rust);
	border-radius: 9px;
	color: var(--pv-rust);
	transition: background .18s ease, color .18s ease;
}
.pv-social .pv-icon { width: 18px; height: 18px; }
.pv-social:hover { background: var(--pv-rust); color: #fff; }

/* ---------- Actions / icônes ---------- */
.pv-actions {
	position: relative;
	z-index: 6;
	display: flex;
	align-items: center;
	gap: 22px;
	flex: 0 0 auto;
}
.pv-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	color: var(--pv-rust);
	text-decoration: none;
	transition: color .18s ease, transform .18s ease;
}
.pv-action:hover { color: var(--pv-rust-dark); transform: translateY(-1px); }
.pv-action--disabled { opacity: .45; }
.pv-action--disabled:hover { opacity: .7; color: var(--pv-rust); transform: none; }

/* Tooltip : nom du picto affiché juste en dessous au survol/focus. */
.pv-action[data-pv-tooltip] { position: relative; }
.pv-action[data-pv-tooltip]::after {
	content: attr(data-pv-tooltip);
	position: absolute;
	top: calc(100% + 12px);
	left: 50%;
	transform: translateX(-50%) translateY(-4px);
	white-space: nowrap;
	background: #fff;
	color: var(--pv-rust);
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	padding: 6px 11px;
	border-radius: 8px;
	box-shadow: 0 8px 20px -8px rgba(23, 23, 23, .28);
	opacity: 0;
	pointer-events: none;
	transition: opacity .18s ease, transform .18s ease;
	z-index: 50;
}
.pv-action[data-pv-tooltip]:hover::after,
.pv-action[data-pv-tooltip]:focus-visible::after {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ---------- Panneau recherche (dans la carte nav) ---------- */
.pv-mega--search { padding-top: 26px; }
.pv-search-panel { margin: 0 auto 22px; max-width: 620px; }
.pv-search-panel__field {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 22px;
	border: 1.5px solid var(--pv-sand);
	border-radius: 999px;
	background: #fff;
	transition: border-color .18s ease;
}
.pv-search-panel__field:focus-within { border-color: var(--pv-rust); }
.pv-search-panel__field .pv-icon { width: 20px; height: 20px; color: var(--pv-rust); flex: 0 0 auto; }
.pv-search-panel__input {
	flex: 1 1 auto;
	border: 0;
	outline: none;
	background: transparent;
	font-family: var(--pv-font);
	font-size: 15px;
	color: var(--pv-ink);
}
.pv-search-panel__input::placeholder { color: #c9c4bc; }
.pv-search-panel__quick {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px 40px;
}
.pv-search-panel__quick a {
	color: var(--pv-ink);
	font-size: 14px;
	text-decoration: none;
	transition: color .18s ease;
}
.pv-search-panel__quick a:hover { color: var(--pv-rust); }

/* ---------- Résultats de recherche instantanée ---------- */
.pv-search-panel__results {
	max-width: 620px;
	margin: -8px auto 22px;
	max-height: 55vh;
	overflow-y: auto;
	background: #fff;
	border: 1.5px solid var(--pv-sand);
	border-radius: 20px;
	padding: 10px;
}
.pv-search-results__group + .pv-search-results__group { margin-top: 6px; }
.pv-search-results__label {
	margin: 10px 14px 6px;
	color: var(--pv-rust);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
}
.pv-search-results__list { list-style: none; margin: 0; padding: 0; }
.pv-search-result {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 14px;
	border-radius: 14px;
	text-decoration: none;
	transition: background .16s ease;
}
.pv-search-result:hover { background: #faf5f0; }
.pv-search-result__thumb {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background: #faf9f7;
	overflow: hidden;
}
.pv-search-result__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pv-search-result__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pv-search-result__title {
	color: var(--pv-ink);
	font-weight: 700;
	font-size: 14px;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.pv-search-result__code { font-size: .7em; color: #9a9a9a; margin-left: 2px; }
.pv-search-result__price { color: var(--pv-rust); font-size: 13px; font-weight: 700; }
.pv-search-result__excerpt {
	color: #9a9a9a;
	font-size: 13px;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.pv-search-results__loading,
.pv-search-results__empty {
	margin: 0;
	padding: 18px 14px;
	text-align: center;
	color: #9a9a9a;
	font-size: 14px;
}
.pv-icon { width: 24px; height: 24px; display: block; }

/* Panier + badge compteur */
.pv-action--cart { position: relative; }
.pv-cart-count {
	position: absolute;
	top: -7px;
	right: -9px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--pv-rust);
	color: #fff;
	font-family: var(--pv-font);
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}
.pv-cart-count[data-cart-count="0"] { display: none; }

/* ---------- Menu compte (dropdown au survol) ---------- */
.pv-account { position: relative; }
.pv-account .pv-action { position: relative; }
.pv-account .pv-action::before {
	content: "";
	position: absolute;
	inset: -10px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 10px 26px -10px rgba(23, 23, 23, .32);
	opacity: 0;
	z-index: -1;
	transition: opacity .2s ease;
}
.pv-account:hover .pv-action::before,
.pv-account:focus-within .pv-action::before { opacity: 1; }

.pv-account-menu {
	position: absolute;
	top: calc(100% + 16px);
	right: -12px;
	transform: translateY(8px);
	z-index: 120;
	width: 264px;
	padding: 26px 26px 24px;
	background: #fff;
	border-radius: 22px;
	box-shadow: 0 34px 66px -30px rgba(23, 23, 23, .38), 0 6px 16px rgba(23, 23, 23, .06);
	display: flex;
	flex-direction: column;
	gap: 14px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.pv-account-menu::before {   /* pont anti-trou de survol */
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -16px;
	height: 16px;
}
.pv-account:hover .pv-account-menu,
.pv-account:focus-within .pv-account-menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}
.pv-account-menu__email {
	color: var(--pv-ink);
	font-weight: 800;
	font-size: 15px;
	margin-bottom: 4px;
	word-break: break-all;
}
.pv-account-menu__item {
	color: var(--pv-ink);
	font-size: 15px;
	line-height: 1.1;
	text-decoration: none;
	transition: color .18s ease, transform .18s ease;
}
a.pv-account-menu__item:hover { color: var(--pv-rust); transform: translateX(3px); }
.pv-account-menu__item.is-disabled { display: none; }
.pv-account-menu__sep { height: 12px; }

.pv-burger { display: none; }

/* ---------- Menu mobile plein écran ---------- */
.pv-mobile {
	position: fixed;
	inset: 0;
	z-index: 200;
	background: var(--pv-bg);
	display: flex;
	flex-direction: column;
	padding: 22px 24px max(28px, env(safe-area-inset-bottom));
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity .3s ease, transform .3s ease;
	overflow-y: auto;
	overflow-x: hidden;
}
.pv-mobile.is-open { opacity: 1; transform: none; }
.pv-mobile[hidden] { display: none; }
/* Halos discrets en fond (même esprit que la fiche produit / la home). */
.pv-mobile::before,
.pv-mobile::after {
	content: "";
	position: fixed;
	width: 340px;
	height: 340px;
	border-radius: 50%;
	filter: blur(70px);
	pointer-events: none;
	z-index: -1;
}
.pv-mobile::before { top: -100px; right: -120px; background: rgba(186, 67, 7, .10); }
.pv-mobile::after { bottom: -80px; left: -120px; background: rgba(232, 203, 180, .6); }

.pv-mobile__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
	margin-bottom: 28px;
}
.pv-mobile__top .pv-action { color: var(--pv-ink); }
.pv-mobile__top .pv-action:hover { color: var(--pv-rust); }
.pv-logo--mobile img { display: block; }

/* ---------- Liste des rubriques ---------- */
.pv-mobile__nav { flex: 1 1 auto; }
.pv-mobile__list { list-style: none; margin: 0; padding: 0; }
.pv-mobile__item { border-bottom: 1px solid var(--pv-line, #ececec); }
.pv-mobile__item:first-child { border-top: 1px solid var(--pv-line, #ececec); }

a.pv-mobile__link,
button.pv-mobile__link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	background: none;
	border: 0;
	padding: 18px 2px;
	font-family: var(--pv-font);
	font-size: 21px;
	font-weight: 700;
	color: var(--pv-ink);
	text-decoration: none;
	text-align: left;
	cursor: pointer;
	transition: color .18s ease;
}
button.pv-mobile__link:active,
a.pv-mobile__link:active { color: var(--pv-rust); }

.pv-mobile__chevron {
	flex: 0 0 auto;
	display: inline-flex;
	color: var(--pv-muted);
	transition: transform .3s cubic-bezier(.4, 0, .2, 1), color .18s ease;
}
.pv-mobile__chevron .pv-icon { width: 18px; height: 18px; }
button.pv-mobile__link[aria-expanded="true"] { color: var(--pv-rust); }
button.pv-mobile__link[aria-expanded="true"] .pv-mobile__chevron { color: var(--pv-rust); transform: rotate(90deg); }

/* Sous-menu : animation de hauteur fluide (0fr → 1fr), même technique que le méga-menu desktop. */
.pv-mobile__panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows .38s cubic-bezier(.4, 0, .2, 1);
}
.pv-mobile__item:has(button.pv-mobile__link[aria-expanded="true"]) .pv-mobile__panel {
	grid-template-rows: 1fr;
}
.pv-mobile__panel-inner { overflow: hidden; }
.pv-mobile__group {
	display: block;
	font-weight: 700;
	color: var(--pv-rust);
	text-decoration: none;
	margin: 16px 0 6px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .06em;
}
.pv-mobile__sub { list-style: none; margin: 0 0 4px; padding: 0; }
.pv-mobile__sub a {
	display: block;
	color: var(--pv-ink);
	text-decoration: none;
	font-size: 16px;
	padding: 9px 2px;
}
.pv-mobile__sub a:active { color: var(--pv-rust); }

/* ---------- CTA + réseaux sociaux (bas de menu) ---------- */
.pv-mobile__cta { flex: 0 0 auto; padding-top: 24px; }
.pv-mobile__cta .pv-btn {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 17px 24px;
}
.pv-mobile__socials {
	flex: 0 0 auto;
	display: flex;
	justify-content: center;
	gap: 22px;
	padding-top: 26px;
	margin-top: 26px;
	border-top: 1px solid var(--pv-line, #ececec);
}
.pv-mobile__socials a {
	color: var(--pv-muted);
	font-family: var(--pv-font);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	text-decoration: none;
}
.pv-mobile__socials a:active { color: var(--pv-rust); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.pv-nav { display: none; }
	.pv-burger { display: inline-flex; }
	.pv-header__inner { padding: 0 16px; gap: 8px; }
	:root { --pv-header-h: 68px; }
	.pv-logo__word { font-size: 20px; }
	/* height/width en !important : l'image a un style inline (height:22px;width:auto)
	   posé par paviterra_render_logo() ; sans ça, un max-width seul déforme le logo
	   (le ratio n'est plus respecté puisque la hauteur inline reste fixe). */
	.pv-logo img { height: 18px !important; width: auto !important; }
	.pv-actions { gap: 16px; }
	/* garde recherche + compte visibles, masque le reste sur petit écran
	   (les wrappers .pv-account/.pv-devis-wrap sont aussi cachés, pas que l'icône
	   à l'intérieur, sinon ils laissent un espace vide qui casse le rythme du gap) */
	.pv-actions .pv-action:not([data-pv-search]):not([data-pv-burger]):not([data-pv-cart]) { display: none; }
	.pv-account { display: none; }

	/* Recherche : la carte nav est masquée sur mobile (remplacée par le burger),
	   donc quand la recherche est ouverte on la fait passer en overlay plein écran. */
	.pv-nav.is-open {
		display: block;
		position: fixed;
		inset: 0;
		left: 0;
		top: 0;
		transform: none;
		z-index: 250;
		width: 100%;
		max-width: none;
		border-radius: 0;
		box-shadow: none;
		overflow-y: auto;
	}
	.pv-nav.is-open .pv-nav__list { display: none; }
	.pv-nav.is-open .pv-nav__panels { grid-template-rows: 1fr; opacity: 1; }
	.pv-nav.is-open .pv-mega:not(.pv-mega--search) { display: none; }
	.pv-mega--search { position: relative; padding: 90px 24px 40px; }
	.pv-search-panel__close {
		position: absolute;
		top: 22px;
		right: 22px;
		color: var(--pv-ink);
	}
}
@media (min-width: 1101px) {
	.pv-search-panel__close { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.pv-header, .pv-mega, .pv-action, .pv-mobile { transition: none; }
}
