/* ── Cortexa Dropdown Button Widget ─────────────────────────── */

.cdb-wrapper {
	position: relative;
	display: inline-block;
}

/* Bouton principal
   !important nécessaire : le thème applique [type=button] { display: inline-block }
   ce qui casse gap et surcharge nos styles. */
.cdb-button {
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;          /* défaut — écrasé par le style inline Elementor */
	cursor: pointer;
	font-family: inherit;
	font-size: inherit;
	line-height: 1;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;

	/* Reset total de la bordure thème ([type=button] { border: 1px solid #c36 }) */
	border-width: 1px !important;
	border-style: solid !important;
	border-color: #ffffff !important; /* défaut blanc — écrasé par Elementor */
	background-image: none;
}

/* Supprime l'outline/box-shadow rouge au focus venant du thème */
.cdb-button:focus,
.cdb-button:active {
	outline: 0 !important;
	box-shadow: none !important;
}

.cdb-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Icône générique */
.cdb-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	align-self: center;
}

.cdb-icon svg,
.cdb-icon img {
	display: block;
	width: 100%;
	height: 100%;
	vertical-align: middle;
}

/* Libellé aligné verticalement */
.cdb-label,
.cdb-item-label {
	display: inline-flex;
	align-items: center;
	align-self: center;
	line-height: 1;
}

/* Flèche de chevron */
.cdb-arrow {
	display: inline-flex;
	align-items: center;
	align-self: center;
	flex-shrink: 0;
	transition: transform 0.25s ease;
}

.cdb-wrapper.is-open .cdb-arrow {
	transform: rotate(180deg);
}

/* Menu déroulant */
.cdb-menu {
	position: absolute;
	top: 100%;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	list-style: none;
	margin: 0;
	padding: 0;
	pointer-events: none;

	/* Animation */
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
	visibility: hidden;
}

/* Alignement gauche / droite */
.cdb-wrapper[data-align="left"]  .cdb-menu { left: 0; right: auto; }
.cdb-wrapper[data-align="right"] .cdb-menu { right: 0; left: auto; }

/* État ouvert */
.cdb-wrapper.is-open .cdb-menu {
	opacity: 1;
	transform: translateY(0);
	visibility: visible;
	pointer-events: auto;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Éléments du menu */
.cdb-item {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	white-space: nowrap;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.cdb-item:hover {
	text-decoration: none;
}

/* Accessibilité : focus visible */
.cdb-item:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}
