/* Menu mobile (< 1024 px) : bouton « Menu » + panneau latéral. Autonome : fonctionne sur l'accueil (Tailwind) et sur les autres pages. */

/* Bureau : rien ne change */
.pmn-burger, .pmn { display: none; }

@media (max-width: 1023px) {
	/* la barre d'onglets défilante est remplacée par le panneau */
	.pcm-nav-desktop { display: none !important; }

	.pmn-burger {
		display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 14px; border-radius: 10px;
		background: #d9232e; color: #fff; border: 0; font: 700 13px/1 "Plus Jakarta Sans", system-ui, sans-serif; cursor: pointer;
		box-shadow: 0 6px 16px rgba(217, 35, 46, .28); -webkit-tap-highlight-color: transparent;
	}
	.pmn-burger:active { transform: scale(.97); }
	.pmn-burger__bars { display: grid; gap: 4px; width: 18px; }
	.pmn-burger__bars i { display: block; height: 2px; border-radius: 2px; background: currentColor; }

	.pmn { position: fixed; inset: 0; z-index: 90; display: block; }
	.pmn[hidden] { display: none; }
	.pmn__backdrop { position: absolute; inset: 0; background: rgba(8, 11, 16, .66); backdrop-filter: blur(2px); animation: pmn-fade .2s ease-out; }
	.pmn__panel {
		position: absolute; top: 0; right: 0; bottom: 0; width: min(90vw, 390px); display: flex; flex-direction: column;
		background: #12171e; color: #e2e8f0; box-shadow: -18px 0 50px rgba(0, 0, 0, .4); animation: pmn-slide .24s ease-out;
		font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.4;
	}
	.pmn__panel *, .pmn__panel *::before, .pmn__panel *::after { box-sizing: border-box; }
	.pmn__panel a { color: inherit; text-decoration: none; }
	@keyframes pmn-slide { from { transform: translateX(100%); } to { transform: none; } }
	@keyframes pmn-fade { from { opacity: 0; } to { opacity: 1; } }

	.pmn__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
	.pmn__head img { display: block; height: 44px; width: auto; }
	.pmn__close { width: 42px; height: 42px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

	.pmn__nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 10px; -webkit-overflow-scrolling: touch; }
	.pmn__link { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 14px 12px; border-radius: 10px; font-weight: 700; font-size: 16px; color: #f1f5f9; cursor: pointer; list-style: none; position: relative; }
	.pmn__link::-webkit-details-marker { display: none; }
	.pmn__link:hover, .pmn__link:active { background: rgba(255, 255, 255, .07); }
	.pmn__link.is-on { background: rgba(217, 35, 46, .16); color: #fff; box-shadow: inset 3px 0 0 #d9232e; }
	.pmn__link svg { flex: none; opacity: .7; transition: transform .2s; }
	.pmn__acc[open] > summary svg { transform: rotate(180deg); }

	.pmn__sub { display: grid; gap: 2px; padding: 2px 4px 10px 12px; margin: 0 0 4px 14px; border-left: 2px solid rgba(255, 255, 255, .1); }
	.pmn__sub a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px; color: #cbd5e1; font-weight: 600; font-size: 14.5px; }
	.pmn__sub a:hover, .pmn__sub a:active { background: rgba(255, 255, 255, .07); color: #fff; }
	.pmn__sub small { font: 600 11px/1 "JetBrains Mono", ui-monospace, monospace; color: #94a3b8; background: rgba(255, 255, 255, .07); border-radius: 999px; padding: 4px 8px; }
	.pmn__sub .pmn__all { color: #d9a766; font-weight: 800; }
	.pmn__sub--grid { grid-template-columns: 1fr 1fr; gap: 2px 6px; }
	.pmn__sub--grid a { padding: 10px 10px; }

	.pmn__foot { padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .09); background: #0d1117; display: grid; gap: 10px; }
	.pmn__cta { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 11px; border: 0; font: 800 14.5px/1 "Plus Jakarta Sans", system-ui, sans-serif; color: #fff; cursor: pointer; }
	.pmn__cta b { background: rgba(255, 255, 255, .22); border-radius: 7px; padding: 3px 8px; font: 700 12px/1 "JetBrains Mono", ui-monospace, monospace; }
	.pmn__cta--quote { background: #d9232e; box-shadow: 0 8px 20px rgba(217, 35, 46, .3); }
	.pmn__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
	.pmn__cta--call { background: #1f2937; border: 1px solid rgba(255, 255, 255, .14); }
	.pmn__cta--wa { background: #16a34a; }
	.pmn__mail { text-align: center; font-size: 13px; color: #cbd5e1; font-weight: 600; word-break: break-all; }
	.pmn__addr { margin: 0; text-align: center; font-size: 11.5px; color: #8793a5; line-height: 1.5; }

	/* connecté : le panneau démarre sous la barre d'administration WordPress */
	.admin-bar .pmn__panel { top: var(--wp-admin--admin-bar--height, 46px); }
	.admin-bar .pmn__backdrop { top: var(--wp-admin--admin-bar--height, 46px); }

	html.pmn-lock, html.pmn-lock body { overflow: hidden; }

	/* en-tête compact : logo + « Devis » + « Menu » sur une ligne, la recherche dessous */
	.pcm-hdr .pmn-wa-word { display: none; }
}

@media (max-width: 460px) {
	.pcm-hdr #header-logo-mount img { height: 2.9rem !important; }
	.pcm-hdr .pmn-wa-ico { display: none; }
	.pmn-burger { padding: 0 12px; }
	.pmn-burger__txt { display: none; }
	.pmn-burger { width: 42px; padding: 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
	.pmn__panel, .pmn__backdrop { animation: none; }
}

/* ancres du menu : le titre de section ne se cache pas sous l'en-tête collant */
#engineering-section, #showroom-section { scroll-margin-top: 120px; }
