/*
 * UCH — Header & Footer
 * Sen Solution Tech
 *
 * À placer dans : wp-content/themes/hello-uch-child/assets/header-footer.css
 */

/* ==========================================================================
   0. Variables (rappel — définies dans style.css)
   ========================================================================== */
:root {
	--uch-header-h: 84px;
}

/* Lien d'évitement (accessibilité) : invisible, sauf au clavier */
.uch-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 10000;
	padding: 12px 20px;
	background: var(--uch-accent, #C1521D);
	color: #fff;
	font-size: 14px;
}
.uch-skip:focus {
	left: 8px;
	top: 8px;
}

/* ==========================================================================
   1. HEADER
   ========================================================================== */

.uch-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background: #fff;
	border-bottom: 1px solid var(--uch-line, #E4E6EB);
}

/* Décale le header collant sous la barre d'admin WordPress */
.admin-bar .uch-header { top: 32px; }
@media (max-width: 782px) {
	.admin-bar .uch-header { top: 46px; }
}

.uch-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;

	max-width: 1280px;
	margin: 0 auto;
	padding: 14px 24px;
}

/* --- Logo --- */
.uch-logo img,
.uch-logo .custom-logo {
	max-height: 56px;
	width: auto;
	display: block;
}

/* Repli texte, tant que le logo n'est pas déposé */
.uch-logo-texte {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	line-height: 1.2;
}
.uch-logo-nom {
	font-size: 20px;
	font-weight: 700;
	color: var(--uch-brand, #1E3977);
}
.uch-logo-slogan {
	font-size: 11px;
	color: var(--uch-muted, #6B7280);
	margin-top: 2px;
}

/* --- Menu principal --- */
.uch-menu {
	display: flex;
	align-items: center;
	gap: 26px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.uch-menu > li { position: relative; }

.uch-menu > li > a {
	display: block;
	padding: 8px 0;
	font-size: 14px;
	color: var(--uch-muted, #6B7280);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease;
}

.uch-menu > li > a:hover,
.uch-menu > li.current-menu-item > a,
.uch-menu > li.current-menu-ancestor > a {
	color: var(--uch-ink, #232A36);
	font-weight: 600;
}

/* Soulignement de la rubrique active */
.uch-menu > li.current-menu-item > a::after,
.uch-menu > li.current-menu-ancestor > a::after {
	content: "";
	display: block;
	height: 2px;
	margin-top: 4px;
	background: var(--uch-accent, #C1521D);
	border-radius: 2px;
}

/* --- Sous-menus (déroulants) --- */
.uch-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	z-index: 10;

	list-style: none;
	margin: 0;
	padding: 8px 0;

	background: #fff;
	border: 1px solid var(--uch-line, #E4E6EB);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);

	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.uch-menu > li:hover > .sub-menu,
.uch-menu > li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.uch-menu .sub-menu a {
	display: block;
	padding: 9px 16px;
	font-size: 13.5px;
	color: var(--uch-muted, #6B7280);
	text-decoration: none;
}

.uch-menu .sub-menu a:hover {
	background: var(--uch-brand-light, #EAEEF6);
	color: var(--uch-ink, #232A36);
}

/* --- Bouton devis --- */
.uch-header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.uch-btn-devis {
	display: inline-block;
	padding: 11px 20px;
	border-radius: 6px;

	background: var(--uch-accent, #C1521D);
	color: #fff !important;

	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;

	transition: background 0.15s ease;
}
.uch-btn-devis:hover {
	background: var(--uch-accent-hover, #A8471A);
}

/* --- Bouton hamburger (mobile) --- */
.uch-burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;

	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
}
.uch-burger span {
	display: block;
	height: 2px;
	width: 22px;
	margin: 0 auto;
	border-radius: 2px;
	background: var(--uch-ink, #232A36);
	transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Croix quand le menu est ouvert */
body.uch-menu-open .uch-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.uch-menu-open .uch-burger span:nth-child(2) { opacity: 0; }
body.uch-menu-open .uch-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   2. MENU MOBILE (panneau latéral)
   ========================================================================== */

.uch-mobile-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity 0.25s ease;
}
body.uch-menu-open .uch-mobile-overlay { opacity: 1; }

.uch-menu-mobile {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 1001;

	display: flex;
	flex-direction: column;

	width: min(84vw, 330px);
	background: #fff;
	box-shadow: -4px 0 24px rgba(0, 0, 0, 0.16);

	transform: translateX(100%);
	transition: transform 0.28s ease;
}
body.uch-menu-open .uch-menu-mobile { transform: translateX(0); }

.uch-menu-mobile-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid var(--uch-line, #E4E6EB);
	font-size: 16px;
	font-weight: 600;
	color: var(--uch-ink, #232A36);
}

.uch-menu-close {
	border: none;
	background: none;
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
	color: var(--uch-muted, #6B7280);
	padding: 0 4px;
}

.uch-menu-mobile nav {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 8px 0;
}

.uch-menu-mobile-liste,
.uch-menu-mobile-liste .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.uch-menu-mobile-liste a {
	display: block;
	padding: 14px 20px;
	font-size: 15px;
	color: var(--uch-ink, #232A36);
	text-decoration: none;
	border-bottom: 1px solid var(--uch-line, #E4E6EB);
}
.uch-menu-mobile-liste a:hover {
	background: var(--uch-brand-light, #EAEEF6);
}

.uch-menu-mobile-liste .sub-menu a {
	padding-left: 36px;
	font-size: 14px;
	color: var(--uch-muted, #6B7280);
}

.uch-btn-devis--mobile {
	margin: 16px 20px 24px;
	text-align: center;
	padding: 14px;
	font-size: 15px;
}

/* Bloque le défilement de la page quand le menu est ouvert */
body.uch-menu-open { overflow: hidden; }

/* ==========================================================================
   3. BASCULE RESPONSIVE
   ========================================================================== */

@media (max-width: 1100px) {
	.uch-nav { display: none; }        /* le menu horizontal disparaît */
	.uch-burger { display: flex; }     /* le hamburger apparaît */
}

@media (max-width: 600px) {
	.uch-btn-devis { display: none; }  /* on garde le header aéré ; le devis reste dans le menu mobile */
	.uch-header-inner { padding: 12px 16px; }
	.uch-logo img, .uch-logo .custom-logo { max-height: 44px; }
	.uch-logo-nom { font-size: 17px; }
}

/* ==========================================================================
   4. FOOTER
   ========================================================================== */

.uch-footer {
	background: var(--uch-brand, #1E3977);
	color: #fff;
	margin-top: 64px;
}

.uch-footer-inner {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1fr;
	gap: 40px;

	max-width: 1280px;
	margin: 0 auto;
	padding: 56px 24px 40px;
}

.uch-footer-titre {
	margin: 0 0 16px;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
}

.uch-footer-coords,
.uch-footer-liens {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.uch-footer-coords li,
.uch-footer-liens li {
	font-size: 13.5px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.78);
}

.uch-footer a {
	color: rgba(255, 255, 255, 0.78);
	text-decoration: none;
	transition: color 0.15s ease;
}
.uch-footer a:hover {
	color: #fff;
	text-decoration: underline;
}

.uch-footer-cta {
	display: inline-block;
	margin-top: 18px;
	padding: 11px 18px;
	border-radius: 6px;

	background: var(--uch-accent, #C1521D);
	color: #fff !important;

	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none !important;
}
.uch-footer-cta:hover {
	background: var(--uch-accent-hover, #A8471A);
}

/* --- Barre légale --- */
.uch-footer-legal {
	border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.uch-footer-legal-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;

	max-width: 1280px;
	margin: 0 auto;
	padding: 20px 24px;

	font-size: 12.5px;
	color: rgba(255, 255, 255, 0.6);
}

.uch-footer-legal-liens {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
}

@media (max-width: 900px) {
	.uch-footer-inner {
		grid-template-columns: 1fr 1fr;
		gap: 32px;
		padding: 44px 20px 32px;
	}
}

@media (max-width: 560px) {
	.uch-footer-inner { grid-template-columns: 1fr; }
	.uch-footer-legal-inner {
		flex-direction: column;
		align-items: flex-start;
		text-align: left;
	}
}
