/* KAMUCO Connexion — menu du compte (icône personnage) */
.kc-um { position: relative; display: inline-block; font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; z-index: 99990; }
.kc-um--right, .kc-um--left { position: fixed; top: 16px; }
.kc-um--right { right: 16px; }
.kc-um--left { left: 16px; }
body.admin-bar .kc-um--right, body.admin-bar .kc-um--left { top: 48px; }
@media (max-width: 782px) { body.admin-bar .kc-um--right, body.admin-bar .kc-um--left { top: 62px; } }

.kc-um-toggle {
	width: 44px; height: 44px; padding: 0; margin: 0;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%; border: 0; cursor: pointer;
	background: var(--kc-accent, #1f6feb); color: #fff;
	box-shadow: 0 2px 8px rgba(16, 24, 40, .18);
	transition: transform .15s, box-shadow .15s;
	overflow: hidden;
}
.kc-um--inline .kc-um-toggle { width: 38px; height: 38px; box-shadow: none; }
.kc-um-toggle:hover { transform: scale(1.05); box-shadow: 0 4px 14px rgba(16, 24, 40, .24); }
.kc-um-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--kc-accent, #1f6feb) 45%, transparent); outline-offset: 2px; }
.kc-um-toggle .kc-um-ico { width: 24px; height: 24px; }
.kc-um-toggle .kc-um-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.kc-um.is-guest .kc-um-toggle { background: #fff; color: var(--kc-accent, #1f6feb); border: 2px solid var(--kc-accent, #1f6feb); }

.kc-um-panel {
	position: absolute; top: calc(100% + 8px); right: 0;
	min-width: 240px; max-width: 86vw; box-sizing: border-box;
	background: #fff; color: #1d2330; text-align: left;
	border: 1px solid #e3e7ee; border-radius: 12px; padding: 6px;
	box-shadow: 0 12px 32px rgba(16, 24, 40, .16);
	animation: kc-um-in .14s ease-out;
}
.kc-um--left .kc-um-panel { right: auto; left: 0; }
.kc-um-panel[hidden] { display: none; }
@keyframes kc-um-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.kc-um-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid #eef1f5; }
.kc-um-head img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.kc-um-head span { display: flex; flex-direction: column; min-width: 0; }
.kc-um-head strong { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-um-head small { color: #6b7385; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.kc-um-item {
	display: flex; align-items: center; gap: 10px;
	padding: 9px 10px; border-radius: 8px;
	color: inherit !important; text-decoration: none !important;
	font-size: 15px; font-weight: 500;
}
.kc-um-item .kc-um-ico { color: #6b7385; flex: none; }
.kc-um-item:hover, .kc-um-item:focus { background: color-mix(in srgb, var(--kc-accent, #1f6feb) 9%, #fff); outline: none; }
.kc-um-item:hover .kc-um-ico, .kc-um-item:focus .kc-um-ico { color: var(--kc-accent, #1f6feb); }
.kc-um-item:focus-visible { box-shadow: inset 0 0 0 2px var(--kc-accent, #1f6feb); }
.kc-um-sep { height: 1px; background: #eef1f5; margin: 4px 6px; }
.kc-um-logout, .kc-um-logout .kc-um-ico { color: #b42318 !important; }
.kc-um-logout:hover, .kc-um-logout:focus { background: #fef3f2; }

/* Dans un menu de navigation du thème */
.kc-um-menu-item { display: flex; align-items: center; list-style: none; }
.kc-um-menu-item .kc-um { z-index: 100000; }

@media (prefers-reduced-motion: reduce) { .kc-um-panel { animation: none; } .kc-um-toggle { transition: none; } }

/* Initiales (fonctionne hors ligne) */
.kc-initials { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--kc-accent, #1f6feb) 14%, #fff); color: var(--kc-accent, #1f6feb); font-weight: 700; letter-spacing: .02em; line-height: 1; }
.kc-um-menu-item .kc-um, .wp-block-navigation + .kc-um { margin-left: 12px; }
.kc-um--inline { vertical-align: middle; }

/* Isolation : certains thèmes (ex. Twenty Twenty-One) stylent tous les boutons et liens de menu. */
.kc-um .kc-um-toggle,
.kc-um .kc-um-toggle:hover,
.kc-um .kc-um-toggle:focus,
.kc-um .kc-um-toggle:active {
	background: var(--kc-accent, #1f6feb) !important;
	color: #fff !important;
	border: 0 !important;
	padding: 0 !important;
	min-width: 0 !important; min-height: 0 !important;
	line-height: 1 !important; text-decoration: none !important;
	border-radius: 50% !important;
	outline-style: none;
}
.kc-um .kc-um-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--kc-accent, #1f6feb) 45%, transparent) !important; outline-offset: 2px !important; }
.kc-um.is-guest .kc-um-toggle, .kc-um.is-guest .kc-um-toggle:hover { background: #fff !important; color: var(--kc-accent, #1f6feb) !important; border: 2px solid var(--kc-accent, #1f6feb) !important; }
.kc-um .kc-um-panel { font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important; letter-spacing: normal !important; text-transform: none !important; }
.kc-um .kc-um-panel .kc-um-item {
	display: flex !important; align-items: center !important; gap: 10px !important;
	padding: 9px 10px !important; margin: 0 !important;
	font-size: 15px !important; font-weight: 500 !important; line-height: 1.3 !important;
	color: #1d2330 !important; background: none; border: 0 !important; box-shadow: none;
	text-decoration: none !important; white-space: nowrap;
}
.kc-um .kc-um-panel .kc-um-item:hover, .kc-um .kc-um-panel .kc-um-item:focus { background: color-mix(in srgb, var(--kc-accent, #1f6feb) 9%, #fff) !important; }
.kc-um .kc-um-panel .kc-um-logout, .kc-um .kc-um-panel .kc-um-logout .kc-um-ico { color: #b42318 !important; }
.kc-um .kc-um-panel .kc-um-logout:hover, .kc-um .kc-um-panel .kc-um-logout:focus { background: #fef3f2 !important; }
.kc-um .kc-um-ico { width: 20px !important; height: 20px !important; flex: none !important; vertical-align: middle !important; margin: 0 !important; display: block !important; fill: none !important; }
.kc-um .kc-um-toggle .kc-um-ico { width: 24px !important; height: 24px !important; }
.kc-um .kc-um-head strong { font-size: 15px !important; color: #1d2330 !important; }
.kc-um .kc-um-head small { font-size: 13px !important; }

/* Bouton flottant : toujours au premier plan ; en mode automatique il n'apparaît
   que si aucun bonhomme n'est visible (en-tête Elementor, menu masqué sur mobile…). */
.kc-um--right, .kc-um--left { z-index: 999999 !important; }
.kc-um--fallback { display: none !important; }
.kc-um--fallback.is-shown { display: inline-block !important; }
.kc-um-menu-item > .kc-um { margin: 0 4px; }

/* Mobile et tablette : le bouton flottant descend en bas de l'écran pour ne pas
   recouvrir le bouton ☰ du menu ; son menu s'ouvre alors vers le haut. */
@media (max-width: 1024px) {
	.kc-um.kc-um--m-bottom-right, .kc-um.kc-um--m-bottom-left,
	body.admin-bar .kc-um.kc-um--m-bottom-right, body.admin-bar .kc-um.kc-um--m-bottom-left {
		top: auto !important;
		bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
	}
	.kc-um.kc-um--m-bottom-right { right: 16px !important; left: auto !important; }
	.kc-um.kc-um--m-bottom-left { left: 16px !important; right: auto !important; }
	.kc-um.kc-um--m-bottom-right .kc-um-panel, .kc-um.kc-um--m-bottom-left .kc-um-panel {
		top: auto !important; bottom: calc(100% + 10px) !important;
		max-height: 70vh; overflow-y: auto;
	}
	.kc-um.kc-um--m-bottom-right .kc-um-panel { right: 0 !important; left: auto !important; }
	.kc-um.kc-um--m-bottom-left .kc-um-panel { left: 0 !important; right: auto !important; }
	.kc-um.kc-um--m-bottom-right .kc-um-toggle, .kc-um.kc-um--m-bottom-left .kc-um-toggle { width: 52px; height: 52px; box-shadow: 0 4px 16px rgba(16, 24, 40, .28); }
}
