/*
 * COMPAK — module "global", phase 3: header, phone off-canvas menu, footer in tecpap.ma's layout.
 * Markup: inc/global-header.php; behaviour: assets/js/global-header.js; tokens: global-10-tecpap.css.
 * Measurements quoted from tecpap.ma (x, y = page pixels).
 */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ========================================================================== Header — shared */
.tp-header { position: relative; z-index: 980; width: 100%; color: var(--tp-dark); }
.tp-header__in { display: flex; align-items: center; }
.tp-header__logo { display: block; flex: none; line-height: 0; }
.tp-header__logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.tp-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 20px;           /* tecpap: links 20px apart … */
	margin: 0;
	padding: 0 10px;       /* … and 10px from the list edges */
	list-style: none;
}
.tp-nav__item { margin: 0; padding: 0; }
.tp-nav__item > a {
	display: block;
	padding: 0 10px;
	color: inherit;
	font-family: var(--tp-font);
	font-size: 16px;
	font-weight: 700;      /* owner: menu in bold (tecpap's 300 was too faint) */
	line-height: 40px;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease;
}
.tp-burger { display: none; }

/* ---- Inner pages, ≥768: white 100px bar, logo left (box 186×87 at y6), menu right (y30; 2 rows y10/y50). */
.tp-header--inner .tp-header__bar {
	height: 100px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.tp-header--inner .tp-header__in { height: 100%; }
.tp-header--inner .tp-header__logo { width: 186px; height: 87px; align-self: flex-start; margin-top: 6px; } /* y6 */
.tp-header--inner .tp-header__logo img { object-position: left center; }
.tp-header--inner .tp-nav { flex: 0 1 auto; min-width: 0; margin-left: auto; }
.tp-header--inner .tp-nav__item > a { color: var(--tp-dark); }
.tp-header--inner .tp-nav__item > a:hover,
.tp-header--inner .tp-nav__item.is-current > a { color: var(--tp-accent); }
@media (max-width: 999px) {
	/* tecpap scales its logo with the window below 1000px (image 144×67 at 960, 114×53 at 768) inside a
	 * link box 1.25× as wide (180 / 142px), which is where its menu starts. */
	.tp-header--inner .tp-header__logo { width: 18.5vw; height: calc(15vw * 87 / 186); align-self: center; margin-top: 0; }
	.tp-header--inner .tp-header__logo img { width: 15vw; }
}

/* ---- Home, ≥768: transparent over the hero, logo centred (409×191 box), menu centred below. */
/* #masthead: beats Header Footer Elementor's `.ehf-header #masthead { position: relative }`. */
#masthead.tp-header--home { position: absolute; top: 0; left: 0; right: 0; }
.admin-bar #masthead.tp-header--home { top: var(--wp-admin--admin-bar--height, 0px); }
.tp-header--home .tp-header__in { flex-direction: column; padding-top: 69px; padding-bottom: 3px; }
.tp-header--home .tp-header__logo { width: 409px; height: 191px; }
.tp-header--home .tp-nav { max-width: 100%; margin-top: 22px; }
/* Centred while it fits on one row; when it wraps (768px) the rows start on the left, like tecpap. */
.tp-header--home .tp-nav__list { justify-content: flex-start; }
/* Owner: the grey 70 % menu barely showed over the video. Near-black bold with a soft white halo so it reads
   on every clip (light kraft bags as well as the darker factory shots). */
.tp-header--home .tp-nav__item > a {
	color: #16211a;
	text-shadow: 0 0 2px rgba(255, 255, 255, 0.95), 0 0 8px rgba(255, 255, 255, 0.85), 0 0 16px rgba(255, 255, 255, 0.6);
}
.tp-header--home .tp-nav__item > a:hover,
.tp-header--home .tp-nav__item > a:focus-visible { color: var(--tp-accent); }
@media (max-width: 1219px) {
	.tp-header--home .tp-header__in { padding-top: 19px; }
}
@media (max-width: 959px) {
	.tp-header--home .tp-header__in { padding-top: 13px; }
	.tp-header--home .tp-header__logo { width: 327px; height: 153px; }
	.tp-header--home .tp-nav { margin-top: 25px; }
}

/* ---- ≤767 (tecpap's small layout): white bar, accent menu button left, logo 140×65 centred (+14px). */
@media (max-width: 767px) {
	#masthead.tp-header--home { position: relative; top: auto; }
	.tp-header .tp-header__bar {
		position: relative;
		height: 113px;
		padding: 0;
		background: #fff;
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
	}
	.tp-header--inner .tp-header__bar { box-sizing: content-box; padding: 15px 0; }
	.tp-header .tp-header__in { display: block; height: 113px; padding: 0; position: relative; }
	.tp-header .tp-nav { display: none; }
	.tp-header .tp-header__logo {
		position: absolute;
		top: 23px;
		left: calc(50% - 70px + 14px);
		width: 140px;
		height: 65px;
	}
	.tp-header .tp-header__logo img { width: 100%; object-position: center; }
	.tp-header .tp-burger {
		position: absolute;
		top: 14px;           /* home: y14; inner pages: y59 (tecpap) */
		left: 10px;          /* x10 (tecpap) */
		display: block;
		width: 44px;
		height: 40px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: var(--tp-accent);
		box-shadow: none;
		cursor: pointer;
	}
	.tp-header--inner .tp-burger { top: 44px; }
	.tp-burger::after { content: ""; position: absolute; inset: -2px 0; } /* 44×44 tap area */
	.tp-burger span {
		position: absolute;
		left: 15px;
		width: 14px;
		height: 2px;
		background: #fff;
	}
	.tp-burger span:nth-child(1) { top: 14px; }
	.tp-burger span:nth-child(2) { top: 19px; }
	.tp-burger span:nth-child(3) { top: 24px; }
	.tp-burger:hover { background: var(--tp-accent-hover); }
}

/* ========================================================================== Off-canvas menu (≤767)
 * tecpap: 280px dark panel (#1a1a1a) from the left over a rgba(34,34,34,.5) layer; items 44px tall,
 * 14px/24px 300 uppercase, padding 10px 15px, #1f1f1f with 2px gaps; current item highlighted.
 */
.tp-offcanvas[hidden] { display: none; }
.tp-offcanvas {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(34, 34, 34, 0.5);
}
.admin-bar .tp-offcanvas { top: var(--wp-admin--admin-bar--height, 0px); }
.tp-offcanvas__bar {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 280px;
	max-width: 85vw;
	overflow-y: auto;
	background: #1a1a1a;
	transform: translateX(-100%);
	transition: transform 0.3s ease;
}
.tp-offcanvas.is-open .tp-offcanvas__bar { transform: none; }
.tp-offcanvas__list { margin: 0; padding: 0; list-style: none; }
.tp-offcanvas__list li { margin: 0 0 2px; padding: 0; }
.tp-offcanvas__list a {
	display: block;
	min-height: 44px;
	box-sizing: border-box;
	padding: 10px 15px;
	background: #1f1f1f;
	color: #fff;
	font-family: var(--tp-font);
	font-size: 14px;
	font-weight: 400;
	line-height: 24px;
	text-transform: uppercase;
	text-decoration: none;
}
.tp-offcanvas__list a:hover { background: #2a2a2a; color: #fff; }
/* Current item: accent with white text (tecpap: light green + dark text; dark text fails contrast on our green). */
.tp-offcanvas__list li.is-current > a { background: var(--tp-accent); color: #fff; }
/* Invisible close target over the dimmed page (tap outside closes too). */
.tp-offcanvas__close {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: min(280px, 85vw);
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent !important;
	box-shadow: none;
	cursor: pointer;
}
html.tp-offcanvas-open { overflow: hidden; }

/* ========================================================================== Footer
 * tecpap: band 221px (1440/1024), padding 40/40, columns 192 · 540 · 308 of 1120 (gap 40; 25 below 1220):
 * logo box (192×88), centred links 13px, contact 14px/24px. Bottom bar 64px, © centred, up-arrow right.
 */
.tp-footer { margin: 0; color: #fff; font-family: var(--tp-font); font-weight: 400; }
.tp-footer a { color: #fff; text-decoration: none; }
.tp-footer a:hover { color: #fff; text-decoration: underline; }
.tp-footer__main { box-sizing: border-box; min-height: 221px; padding: 41px 0 40px; background: var(--tp-dark); } /* tecpap band 221px */
.tp-footer__grid {
	display: grid;
	grid-template-columns: 192fr 540fr 308fr;
	column-gap: 40px;
	align-items: start;
}
.tp-footer__logo { display: block; aspect-ratio: 192 / 88; line-height: 0; }
.tp-footer__logo img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.tp-footer__nav ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 4px;
	margin: 43px 0 0;
	padding: 0;
	list-style: none;
	text-align: center;
}
.tp-footer__nav li { margin: 0; padding: 0 3px; font-size: 16px; line-height: 25px; }
.tp-footer__nav a { position: relative; font-size: 13px; line-height: inherit; vertical-align: top; }
.tp-footer__contact p { margin: 0 0 10px; font-size: 14px; line-height: 24px; }
.tp-footer__contact p:last-child { margin-bottom: 0; }
.tp-footer__bar { padding: 20px 0; background: var(--tp-dark-2); }
.tp-footer__bar-in { position: relative; }
.tp-footer__bar p { margin: 0; font-size: 14px; line-height: 24px; text-align: center; }
.tp-footer__bar p a { color: #9fd8ad; }
.tp-footer__sep { margin: 0 6px; opacity: 0.6; }
.tp-footer__bar p a.tp-footer__legal { color: rgba(255, 255, 255, 0.8); } /* discreet */
.tp-totop {
	position: absolute;
	top: 0;
	right: 40px;           /* container padding: the arrow sits on the content's right edge (x1260 at 1440) */
	width: 20px;
	height: 20px;
	color: rgba(255, 255, 255, 0.45); /* tecpap: faint chevron */
}
.tp-totop::before {       /* chevron */
	content: "";
	position: absolute;
	left: 6px;
	top: 8px;
	width: 7px;
	height: 7px;
	border-top: 1.5px solid currentColor;
	border-left: 1.5px solid currentColor;
	transform: rotate(45deg);
}
.tp-totop::after { content: ""; position: absolute; inset: -12px; } /* 44×44 tap area */
.tp-totop:hover { color: #fff; }
@media (max-width: 1219px) {
	.tp-footer__grid { column-gap: 25px; }
	.tp-footer__nav ul { margin-top: 25px; }
	.tp-totop { right: 35px; }
}
@media (max-width: 959px) { .tp-totop { right: 25px; } }
@media (max-width: 767px) {
	.tp-footer__main { min-height: 385px; } /* tecpap band at 390 */
	.tp-footer__sep { display: none; }
	.tp-footer__bar p a.tp-footer__legal { display: block; }
	.tp-footer__grid { grid-template-columns: minmax(0, 1fr); }
	.tp-footer__logo { width: 195px; }
	.tp-footer__nav ul { margin-top: 25px; }
	/* Taller tap targets without moving the links (≥44px). */
	.tp-footer__nav a::after,
	.tp-footer__contact a::after { content: ""; position: absolute; inset: -10px -2px; }
	.tp-footer__contact a { position: relative; }
}

/* ========================================================================== Page background
 * tecpap's body is #1a1a1a (visible below the footer on short pages); every content area stays white.
 * body.tp-site beats the Elementor kit's body background (#fff). */
html,
html body.tp-site { background-color: #1a1a1a; }
body.tp-site #content,
body.tp-site .site-content { background-color: #fff; }

/* ========================================================================== Beautify pass (owner's request)
 * 4. "Demander un devis" button at the end of the menu (green, always visible), "Devis" on phones.
 * 3. Floating WhatsApp button, bottom-right on every page.
 */
.tp-nav__item--cta { display: flex; align-items: center; margin-left: 10px; }
.tp-nav__item.tp-nav__item--cta > a.tp-nav__cta {
	padding: 0 22px;
	border-radius: 6px;
	background: var(--tp-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 42px;
	letter-spacing: 0.03em;
	text-shadow: none;
	box-shadow: 0 4px 14px rgba(0, 82, 31, 0.22);
	transition: background-color 0.15s ease, transform 0.15s ease;
}
.tp-nav__item.tp-nav__item--cta > a.tp-nav__cta:hover,
.tp-nav__item.tp-nav__item--cta > a.tp-nav__cta:focus-visible { background: var(--tp-accent-hover); color: #fff; transform: translateY(-1px); }
.tp-header--home .tp-nav__list { align-items: center; }
.tp-header--inner .tp-nav__list { align-items: center; }
/* Inner pages, 768–1199: the menu wraps; keep the button on the first row's end and tighten the links. */
@media (max-width: 1199px) {
	.tp-nav__list { gap: 0 8px; }
	.tp-nav__item.tp-nav__item--cta > a.tp-nav__cta { padding: 0 16px; font-size: 13px; }
	/* Inner pages: logo + 4 links + button on one row down to 1000 px. */
	.tp-header--inner .tp-nav__list { flex-wrap: nowrap; padding: 0; }
	.tp-header--inner .tp-nav__item > a { padding: 0 6px; font-size: 14px; }
}
/* Inner pages 768–999: the menu wraps as before; the button stays in the home page's contact form link. */
@media (max-width: 999px) {
	.tp-header--inner .tp-nav__list { flex-wrap: wrap; }
	.tp-header--inner .tp-nav__item--cta { display: none; }
}
.tp-header__devis { display: none; }
@media (max-width: 767px) {
	.tp-header .tp-header__devis {
		position: absolute;
		top: 14px;
		right: 10px;
		display: flex;
		align-items: center;
		height: 40px;
		padding: 0 14px;
		border-radius: 4px;
		background: var(--tp-accent);
		color: #fff;
		font-size: 13px;
		font-weight: 700;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		text-decoration: none;
	}
	.tp-header--inner .tp-header__devis { top: 44px; }
	.tp-header .tp-header__devis:hover { background: var(--tp-accent-hover); color: #fff; }
}

.tp-wa {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 990;
	display: flex;
	align-items: center;
	gap: 0;
	height: 58px;
	min-width: 58px;
	padding: 0 15px;
	box-sizing: border-box;
	border-radius: 29px;
	background: #25d366;
	color: #fff;
	text-decoration: none;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tp-wa svg { flex: none; width: 28px; height: 28px; }
.tp-wa__label {
	max-width: 0;
	overflow: hidden;
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	transition: max-width 0.25s ease, margin 0.25s ease;
}
.tp-wa:hover, .tp-wa:focus-visible { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28); }
.tp-wa:hover .tp-wa__label, .tp-wa:focus-visible .tp-wa__label { max-width: 120px; margin-left: 10px; }
@media (max-width: 767px) { .tp-wa { right: 14px; bottom: 14px; height: 54px; min-width: 54px; padding: 0 13px; } }
@media (prefers-reduced-motion: reduce) { .tp-wa, .tp-wa__label { transition: none; } }
@media print { .tp-wa { display: none; } }

/* 7. Gentle fade-in on scroll (assets/js/global-polish.js adds .tp-anim to <html> only when it runs and the
 *    visitor has not asked for reduced motion). `translate` is used, not `transform`, so the cards' own hover
 *    lift (transform) still works. */
.tp-anim .tp-reveal {
	opacity: 0;
	translate: 0 26px;
	transition: opacity 0.7s ease, translate 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.25s ease, box-shadow 0.25s ease;
}
.tp-anim .tp-reveal.is-in { opacity: 1; translate: 0 0; }
@media print { .tp-anim .tp-reveal { opacity: 1; translate: none; } }

/* Social links (footer under the logo, contact block): round icons. */
.tp-social { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.tp-social li { margin: 0; padding: 0; }
.tp-social a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--tp-accent);
	color: #fff;
	transition: background-color 0.15s ease, transform 0.15s ease;
}
.tp-social a:hover, .tp-social a:focus-visible { background: var(--tp-accent-hover); color: #fff; transform: translateY(-2px); }
.tp-social svg { width: 20px; height: 20px; fill: currentColor; }
.tp-social--light a { background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.tp-social--light a:hover, .tp-social--light a:focus-visible { background: #fff; color: var(--tp-dark); }
.tp-contact__follow { margin: 20px 0 0 !important; }
.tp-contact__siege .tp-social { margin-top: 10px; }
.tp-contact .tp-contact__siege .tp-social a,
.tp-contact .tp-contact__siege .tp-social a:hover { color: #fff; text-decoration: none; }

/* "Télécharger le catalogue" (compak_fx_global_catalogue_button): download icon, label, "PDF · 6 Mo". */
.tp-btn.tp-btn--catalogue { display: inline-flex; align-items: center; gap: 10px; }
.tp-btn--catalogue svg { flex: none; width: 20px; height: 20px; }
.tp-btn--catalogue small { font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; opacity: 0.85; }
/* White button on the green "Nos produits" band. */
.tp-btn.tp-btn--light { background: #fff; color: var(--tp-accent); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.tp-btn.tp-btn--light:hover, .tp-btn.tp-btn--light:focus { background: #f1f7f3; color: var(--tp-accent-hover); }
.tp-btn--lg.tp-btn--catalogue { padding: 14px 28px; font-size: 15px; border-radius: 6px; }
.tp-gammes__catalogue { margin: 40px 0 0; text-align: center; }
/* Footer: outlined white button under the contact details. */
.tp-footer__contact .tp-btn--catalogue-footer {
	margin-top: 16px;
	padding: 9px 18px;
	background: transparent;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
	color: #fff;
	font-size: 13px;
}
.tp-footer__contact .tp-btn--catalogue-footer:hover { background: #fff; color: var(--tp-dark); }
.tp-offcanvas__list .tp-offcanvas__catalogue a { background: var(--tp-accent); color: #fff; }
@media (max-width: 767px) {
	.tp-gammes__catalogue { margin-top: 30px; }
	.tp-btn--lg.tp-btn--catalogue { padding: 12px 16px; font-size: 13px; }
	.tp-btn--catalogue small { display: none; }
}
.tp-footer__contact .tp-btn--catalogue-footer { white-space: nowrap; }
.tp-footer__contact .tp-btn--catalogue-footer small { display: none; }
