/* Header de marque (H.2). Mobile-first puis amélioration desktop.
   Le header parent Twenty Twenty-Five est masqué via les sélecteurs en bas. */

.apa-site-header {
	background: #1b3a6b;
	color: #fff;
	font-family: 'Inter', system-ui, sans-serif;
	position: sticky;
	top: 0;
	z-index: 45;
	box-shadow: 0 2px 12px rgba(0,0,0,.14);
}

.apa-site-header-in {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 16px;
}

.apa-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	color: inherit;
	text-decoration: none;
	font-family: var(--apa-font-display, 'Poppins', 'Inter', system-ui, sans-serif);
	min-width: 0;
	margin-right: 22px;
}
/* Préfixe .apa-site-header : porte la spécificité à 0-2-0 pour battre la règle
   WooCommerce « .woocommerce-page img { height:auto } » (0-1-1) qui, sur les
   pages boutique / mon-compte, faisait exploser le logo à sa taille naturelle. */
.apa-site-header .apa-brand-logo {
	height: 72px;
	width: auto;
	max-width: none;
	display: block;
	background: #fff;
	border-radius: 12px;
	padding: 6px 12px;
	box-shadow: 0 3px 10px rgba(0,0,0,.18);
}
.apa-brand-baseline {
	font-family: 'Caveat', 'Segoe Script', 'Bradley Hand', cursive;
	font-size: 1.18rem;
	line-height: 1;
	color: rgba(255,255,255,.92);
	font-weight: 600;
	padding-left: 4px;
	white-space: nowrap;
}
/* Anciennes classes marque (pastille/nom) — conservées inertes. */
.apa-brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.apa-brand-name { font-weight: 700; font-size: 1.05rem; }

/* ---- Nav (desktop) ------------------------------------------------ */

.apa-site-nav-wrap { display: none; flex: 1 1 auto; }
.apa-site-nav {
	display: flex;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
	justify-content: center;
}
.apa-site-nav li { list-style: none; }
.apa-site-nav a {
	color: rgba(255,255,255,.92);
	text-decoration: none;
	font-weight: 500;
	font-size: .95rem;
	padding: 8px 12px;
	border-radius: 8px;
	white-space: nowrap;
}
.apa-site-nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
.apa-site-nav .current-menu-item > a,
.apa-site-nav .current_page_item > a {
	background: rgba(246,196,83,.18);
	color: #f6c453;
}

/* ---- Icones droite ----------------------------------------------- */

.apa-site-header-icons { display: flex; gap: 4px; margin-left: auto; align-items: center; }

/* ---- Recherche produits (mobile-first, masquée < tablet) ---------- */

.apa-h-search {
	display: none;
	position: relative;
	margin-left: 12px;
}
.apa-h-search-ico {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-size: .95rem;
	pointer-events: none;
	opacity: .7;
}
.apa-h-search-input {
	background: rgba(255,255,255,.12);
	border: 1px solid rgba(255,255,255,.22);
	color: #fff !important;
	padding: 8px 42px 8px 34px;
	border-radius: 999px;
	font-family: inherit;
	font-size: .92rem;
	/* Largeur 100 % du form (lui-même de largeur fixe sur desktop).
	   Aucune transition de width — sinon le bouton submit, positionné
	   en absolute par rapport au form, donne l'impression de bouger
	   entre l'état au repos et l'état focus. */
	width: 100%;
	box-sizing: border-box;
	min-height: 36px;
	transition: background .15s, border-color .15s;
}
.apa-h-search-input::placeholder { color: rgba(255,255,255,.65); }
.apa-h-search-input:focus {
	outline: none;
	background: rgba(255,255,255,.20);
	border-color: rgba(255,255,255,.45);
}
.apa-h-search-submit {
	position: absolute;
	right: 4px;
	top: 50%;
	transform: translateY(-50%);
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 0;
	background: var(--apa-orange, #f7864a);
	color: #fff;
	cursor: pointer;
	font-weight: 800;
	font-size: 1rem;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.apa-h-search-submit:hover { background: var(--apa-orange-fonce, #e36a2e); }

/* Dropdown des suggestions */
.apa-h-search-suggest {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 24px rgba(0,0,0,.15);
	overflow: hidden;
	z-index: 90;
}
.apa-h-search-suggest[hidden] { display: none; }
.apa-h-search-suggest a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	text-decoration: none;
	color: #14202d;
	font-size: .88rem;
	border-bottom: 1px solid rgba(0,0,0,.05);
}
.apa-h-search-suggest a:last-child { border-bottom: 0; }
.apa-h-search-suggest a:hover,
.apa-h-search-suggest a.is-active {
	background: rgba(247,134,74,.10);
	color: var(--apa-bleu, #1b3a6b);
}
.apa-h-search-suggest .apa-h-search-thumb {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--apa-vignette-bg, #eef0f4);
}
.apa-h-search-suggest .apa-h-search-empty {
	padding: 12px 14px;
	color: rgba(20,32,45,.7);
	font-size: .86rem;
	font-style: italic;
}

/* Sur tablette+ : la recherche apparaît. Sur mobile, on la propose
   en-dessous dans le drawer (rendu plus loin par apa-drawer-search). */
@media (min-width: 720px) {
	.apa-h-search { display: flex; align-items: center; }
}

/* ── Recherche sur sa PROPRE LIGNE, sous le menu (desktop). Cachée en mobile
   (la recherche mobile est dans le drawer). Le fond bleu vient du header. ── */
.apa-site-header-searchrow { display: none; }
@media (min-width: 720px) {
	.apa-site-header-searchrow {
		display: block;
		max-width: 1200px;
		margin: 0 auto;
		padding: 0 16px 12px; /* aligne le contenu avec la 1re ligne */
	}
	/* Barre compacte, CENTRÉE sous le menu (Boutique / Comment ça marche). */
	.apa-site-header-searchrow .apa-h-search {
		display: flex;
		width: 520px;
		max-width: 100%;
		margin: 0 auto;
	}
}
@media (min-width: 880px) {
	.apa-site-header-searchrow { padding: 0 32px 12px; }
}
/* Sur écran large : on REMONTE la recherche sur la MÊME LIGNE que la baseline
   « on crée et imprime vos événements » (centre à centre). Le décalage vertical
   mesuré est ~40px ; en dessous de 1100px on garde la recherche sur sa propre
   ligne (sinon elle chevaucherait la baseline qui est à gauche). */
@media (min-width: 1100px) {
	.apa-site-header-searchrow { margin-top: -40px; }
}
.apa-h-ico {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	/* Couleur forcée blanche pour battre les règles a:where(...)
	   du block theme parent qui peuvent surcharger color: inherit. */
	color: #fff !important;
	text-decoration: none;
	padding: 8px 10px;
	border-radius: 999px;
	font-size: .85rem;
	white-space: nowrap;
}
.apa-h-ico:hover { background: rgba(255,255,255,.10); color: #fff !important; }
.apa-h-ico .apa-h-lbl,
.apa-h-ico .apa-h-emoji { color: #fff; }
.apa-h-emoji { font-size: 1.05rem; }
.apa-h-lbl { display: none; }
/* Nom de connexion affiché à côté de « Mon compte » quand le client est connecté
   (le séparateur « · » est dans le markup pour ne pas dépendre du cache CSS). */
.apa-h-user { font-weight: 600; }
.apa-h-cart { position: relative; }
.apa-h-cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #ef5a4c;
	color: #fff;
	font-weight: 700;
	min-width: 20px;
	height: 20px;
	border-radius: 999px;
	font-size: .72rem;
	padding: 0 5px;
	margin-left: 2px;
}
.apa-h-cart-count.is-empty { background: rgba(255,255,255,.18); color: rgba(255,255,255,.7); }

/* ---- Burger mobile ----------------------------------------------- */

.apa-burger {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	padding: 8px;
	cursor: pointer;
	margin-left: auto;
}
.apa-burger span {
	display: block;
	height: 2px;
	width: 100%;
	background: #fff;
	border-radius: 2px;
	transition: transform .18s, opacity .18s;
}
.apa-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.apa-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.apa-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Drawer mobile ----------------------------------------------- */

.apa-drawer {
	background: #1b3a6b;
	padding: 8px 16px 16px;
	border-top: 1px solid rgba(255,255,255,.10);
}
.apa-drawer[hidden] { display: none; }
/* Recherche dans le drawer mobile (visible quand on ouvre le burger). */
.apa-drawer-search {
	display: flex;
	gap: 8px;
	margin: 6px 0 14px;
}
.apa-drawer-search input[type="search"] {
	flex: 1 1 auto;
	background: rgba(255,255,255,.15);
	border: 1px solid rgba(255,255,255,.30);
	color: #fff;
	padding: 11px 14px;
	border-radius: 999px;
	font-family: inherit;
	font-size: .95rem;
}
.apa-drawer-search input::placeholder { color: rgba(255,255,255,.65); }
.apa-drawer-search input:focus { outline: none; background: rgba(255,255,255,.25); }
.apa-drawer-search button {
	background: var(--apa-orange, #f7864a);
	color: #fff;
	border: 0;
	border-radius: 999px;
	width: 44px;
	font-size: 1.05rem;
	cursor: pointer;
}
.apa-drawer-search button:hover { background: var(--apa-orange-fonce, #e36a2e); }

.apa-drawer .apa-site-nav {
	flex-direction: column;
	gap: 2px;
	justify-content: flex-start;
	align-items: stretch;
}
.apa-drawer .apa-site-nav a {
	display: block;
	padding: 12px 14px;
	border-radius: 10px;
	min-height: 48px;
	display: flex;
	align-items: center;
}
.apa-drawer-icons {
	display: flex;
	gap: 8px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed rgba(255,255,255,.15);
	flex-wrap: wrap;
}
.apa-drawer-icons a {
	flex: 1 1 auto;
	color: #fff;
	text-decoration: none;
	padding: 10px 14px;
	border-radius: 10px;
	background: rgba(255,255,255,.08);
	text-align: center;
	min-height: 44px;
}

/* ---- Responsive : nav inline à partir de 880px ------------------- */

@media (min-width: 880px) {
	.apa-burger { display: none; }
	.apa-site-nav-wrap { display: block; }
	.apa-h-lbl { display: inline; }
	.apa-h-ico { font-size: .9rem; }
	.apa-drawer { display: none !important; }
	.apa-site-header-in { padding: 12px 32px; }
}

/* ---- Masque le header de Twenty Twenty-Five ---------------------- */

body > .wp-site-blocks > header.wp-block-template-part,
body.apa-has-site-header header.wp-block-template-part {
	display: none !important;
}

/* Body padding pour compenser le sticky header. */
body.apa-has-site-header { margin-top: 0; }

/* Quand notre header est posé, on cale aussi le bandeau cookies pour
   qu'il ne masque pas le footer mobile. */
.apa-cookie-banner { z-index: 99999; }

/* ── Menu déroulant du compte (header, utilisateur connecté) ─────────────── */
.apa-account-dd { position: relative; }
.apa-account-dd > .apa-account-toggle {
	list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.apa-account-dd > .apa-account-toggle::-webkit-details-marker { display: none; }
.apa-account-dd > .apa-account-toggle::marker { content: ''; }
.apa-account-caret { font-size: .68em; opacity: .85; transition: transform .15s ease; }
.apa-account-dd[open] .apa-account-caret { transform: rotate(180deg); }
.apa-account-menu {
	position: absolute; top: calc(100% + 12px); right: 0; z-index: 200; min-width: 224px;
	background: #fff; border: 1px solid #e3e8f0; border-radius: 12px;
	box-shadow: 0 14px 34px rgba(16, 34, 64, .22); padding: 6px;
}
.apa-account-menu::before {
	content: ''; position: absolute; top: -6px; right: 26px; width: 12px; height: 12px;
	background: #fff; border-left: 1px solid #e3e8f0; border-top: 1px solid #e3e8f0;
	transform: rotate(45deg);
}
.apa-account-menu a {
	display: block; padding: 10px 14px; border-radius: 8px; text-decoration: none;
	color: #1b3a6b; font-size: .95rem; font-weight: 600; white-space: nowrap;
}
.apa-account-menu a:hover { background: #eef3fa; }
.apa-account-menu a.apa-account-logout { color: #d8412f; }
.apa-account-menu a.apa-account-logout:hover { background: #fdece9; }
