/* Layout only — couleurs / boutons / typo = thème Woodmart */

.lh-avatar-app {
	--lh-sticky-top: calc(var(--wd-header-sticky-h, 72px) + var(--wd-admin-bar-h, 0px) + 12px);
	margin: 0 0 2rem;
	width: 100%;
	max-width: none;
}

.lh-avatar-app__header {
	margin: 0 0 0.5rem;
}

.lh-avatar-app__lead {
	margin: 0.35rem 0 0;
	max-width: 42rem;
	line-height: 1.5;
	opacity: 0.85;
}

.lh-avatar-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1rem 0 1.25rem;
}

.lh-avatar-toolbar--actions {
	position: sticky;
	bottom: 0;
	z-index: 3;
	margin: 1.25rem 0 0;
	padding: 0.85rem 0;
	background: linear-gradient(180deg, transparent, var(--wd-main-bgcolor, #fff) 28%);
}

.lh-avatar-toolbar .btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.lh-avatar-btn-danger {
	color: var(--wd-primary-color, #c0392b) !important;
}

/* Liste — cartes type produit (pas des <button> thème) */
.lh-avatar-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
	gap: 1.25rem;
	margin: 1rem 0;
}

.lh-avatar-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 14rem;
	margin: 0;
	padding: 0;
	overflow: hidden;
	cursor: pointer;
	text-align: start;
	background: var(--wd-main-bgcolor, #fff);
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: var(--wd-brd-radius, 0);
	box-shadow: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.lh-avatar-card:hover,
.lh-avatar-card:focus {
	outline: none;
	border-color: var(--wd-primary-color, currentColor);
	box-shadow: 0 0 0 1px var(--wd-primary-color, currentColor);
	transform: translateY(-1px);
}

.lh-avatar-card__media {
	position: relative;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: var(--color-gray-100, #f7f7f7);
}

.lh-avatar-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lh-avatar-placeholder {
	display: grid;
	place-items: center;
	height: 100%;
	min-height: 8rem;
	font-size: 2.25rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	opacity: 0.4;
	background: linear-gradient(160deg, var(--color-gray-100, #f7f7f7), var(--color-gray-200, #eee));
}

.lh-avatar-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	padding: 0.85rem 0.9rem 1rem;
}

.lh-avatar-card__name {
	margin: 0;
	font-weight: 600;
	font-size: 1.05rem;
	line-height: 1.25;
	text-transform: none;
}

.lh-avatar-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.65rem;
}

.lh-avatar-badge {
	display: inline-block;
	padding: 0.15rem 0.5rem;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	border-radius: var(--wd-brd-radius, 0);
	background: var(--color-gray-200, #eee);
	color: inherit;
	opacity: 0.9;
}

.lh-avatar-badge.is-validated {
	background: color-mix(in srgb, var(--wd-primary-color, #2d5a3d) 18%, transparent);
	color: var(--wd-primary-color, #2d5a3d);
	opacity: 1;
}

.lh-avatar-badge.is-draft {
	background: var(--color-gray-100, #f3f3f3);
	opacity: 0.85;
}

.lh-avatar-card__quota {
	font-size: 0.8rem;
	opacity: 0.7;
}

.lh-avatar-card__cta {
	align-self: flex-start;
	margin-top: 0.15rem;
	min-height: 0 !important;
	padding: 0.35rem 0.85rem !important;
	font-size: 0.8rem !important;
	pointer-events: none;
}

/* Éditeur : colonne flottante + formulaire */
.lh-avatar-editor {
	width: 100%;
}

.lh-avatar-editor__layout {
	display: grid;
	grid-template-columns: minmax(220px, 17rem) minmax(0, 1fr);
	gap: 1.5rem 1.75rem;
	align-items: start;
	width: 100%;
}

/* Conteneurs WC / Woodmart : éviter overflow qui casse sticky */
.woocommerce-MyAccount-content .lh-avatar-app,
.woocommerce-account .lh-avatar-app,
.wd-my-account-content .lh-avatar-app {
	overflow: visible;
}

.woocommerce-MyAccount-content:has(.lh-avatar-app),
.woocommerce-account .woocommerce-MyAccount-content:has(.lh-avatar-app) {
	overflow: visible;
}

.lh-avatar-preview {
	position: sticky;
	top: var(--lh-sticky-top);
	z-index: 5;
	align-self: start;
	width: 100%;
}

.lh-avatar-preview__card {
	padding: 0.75rem;
	background: var(--wd-main-bgcolor, #fff);
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: var(--wd-brd-radius, 0);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.lh-avatar-preview__frame {
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: var(--wd-brd-radius, 0);
	background: var(--color-gray-100, #f7f7f7);
	overflow: hidden;
	min-height: 10rem;
}

.lh-avatar-preview__frame svg,
.lh-avatar-preview__photo {
	display: block;
	width: 100%;
	height: auto;
}

.lh-avatar-preview__photo {
	aspect-ratio: 3 / 4;
	object-fit: cover;
	background: var(--color-gray-100, #f7f7f7);
}

.lh-avatar-quota {
	margin: 0.55rem 0 0;
	font-size: 0.85rem;
	opacity: 0.75;
	text-align: center;
}

.lh-avatar-editor__controls {
	min-width: 0;
}

.lh-avatar-identity {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 13rem;
	gap: 0 1rem;
	align-items: start;
	margin: 0 0 1.1rem;
}

.lh-avatar-identity .form-row {
	margin: 0 0 0.75rem;
	float: none !important;
	width: auto !important;
	max-width: none !important;
	padding: 0;
}

.lh-avatar-identity .form-row-first,
.lh-avatar-identity .form-row-last {
	float: none !important;
	width: auto !important;
}

.lh-avatar-identity .description {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.75rem;
	opacity: 0.75;
	line-height: 1.35;
	font-style: italic;
  	text-align: center;
}

.lh-avatar-trait {
	border: 0;
	margin: 0 0 1.1rem;
	padding: 0;
}

.lh-avatar-trait legend {
	display: block;
	float: none;
	width: 100%;
	margin: 0 0 0.45rem;
	padding: 0;
	font-weight: 600;
	font-size: 0.95rem;
}

.lh-avatar-trait__opts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.lh-avatar-trait__opts .btn {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	min-height: 0;
	padding: 0.35rem 0.75rem;
	font-size: 0.85rem;
	line-height: 1.3;
}

.lh-avatar-trait__opts .btn.is-active,
.lh-avatar-trait__opts .btn[aria-pressed="true"] {
	border-color: var(--wd-primary-color, currentColor);
	box-shadow: inset 0 0 0 1px var(--wd-primary-color, currentColor);
}

.lh-avatar-trait-text {
	width: 100%;
	max-width: 100%;
}

.lh-avatar-swatch {
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.15);
	flex: 0 0 auto;
}

.lh-avatar-candidates-block {
	margin: 0.75rem 0 0;
}

.lh-avatar-candidates-title {
	margin: 0 0 0.3rem;
	font-size: 0.9rem;
	font-weight: 600;
}

.lh-avatar-candidates-hint {
	margin: 0 0 0.55rem;
	font-size: 0.8rem;
	opacity: 0.75;
	line-height: 1.35;
}

/* Miniatures compactes sous l’aperçu flottant */
.lh-avatar-preview .lh-avatar-candidates {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
	gap: 0.45rem;
	margin: 0;
	justify-content: stretch;
}

.lh-avatar-preview .lh-avatar-candidate {
	width: auto;
	min-width: 0;
}

.lh-avatar-preview .lh-avatar-candidate__label {
	display: none;
}

.lh-avatar-candidates {
	display: grid;
	grid-template-columns: repeat(auto-fill, 7.5rem);
	gap: 0.75rem;
	margin: 0;
	justify-content: start;
}

.lh-avatar-candidate {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 7.5rem;
	appearance: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	text-align: center;
	background: var(--color-gray-100, #f7f7f7);
	border: 3px solid transparent;
	border-radius: var(--wd-brd-radius, 0);
	overflow: hidden;
	box-shadow: none;
	min-height: 0;
	line-height: 1.2;
	text-transform: none;
	font-weight: 500;
	color: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lh-avatar-candidate:hover,
.lh-avatar-candidate:focus {
	border-color: rgba(0, 0, 0, 0.25);
	outline: none;
}

.lh-avatar-candidate.is-selected,
.lh-avatar-candidate[aria-pressed="true"] {
	border-color: var(--wd-primary-color, currentColor);
	box-shadow: 0 0 0 1px var(--wd-primary-color, currentColor);
}

.lh-avatar-candidate img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	background: var(--color-gray-100, #f7f7f7);
}

.lh-avatar-candidate__fallback {
	display: grid;
	place-items: center;
	width: 100%;
	aspect-ratio: 3 / 4;
	padding: 0.5rem;
	font-size: 0.8rem;
	font-weight: 600;
	opacity: 0.65;
	background: var(--color-gray-200, #eee);
}

.lh-avatar-candidate__label {
	display: block;
	padding: 0.35rem 0.25rem 0.45rem;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.2;
	opacity: 0.75;
}

.lh-avatar-candidate__badge {
	position: absolute;
	left: 0.25rem;
	top: 0.25rem;
	padding: 0.12rem 0.35rem;
	font-size: 0.6rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: #fff;
	background: var(--wd-primary-color, #333);
	border-radius: var(--wd-brd-radius, 0);
}

.lh-avatar-empty {
	margin: 1rem 0;
}

.lh-avatar-app.is-busy .lh-avatar-editor {
	opacity: 0.72;
	pointer-events: none;
}

@media (max-width: 900px) {
	.lh-avatar-editor__layout {
		grid-template-columns: minmax(200px, 14rem) minmax(0, 1fr);
		gap: 1.25rem;
	}
}

@media (max-width: 782px) {
	.lh-avatar-editor__layout {
		grid-template-columns: 1fr;
	}

	.lh-avatar-preview {
		position: static;
		z-index: auto;
		max-width: 18rem;
		margin: 0 auto;
	}

	.lh-avatar-preview__card {
		box-shadow: none;
	}

	.lh-avatar-identity {
		grid-template-columns: 1fr;
	}

	.lh-avatar-toolbar--actions {
		position: sticky;
		bottom: 0;
	}
}

/* Produit WooCommerce — sélecteur héros */
.lh-hero-picker {
	margin: 1rem 0 1.25rem;
	padding: 1rem 0;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.lh-hero-picker__mode {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	margin: 0.75rem 0;
}

.lh-hero-picker__option {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0;
	padding: 0.55rem 0.9rem 0.55rem 0.7rem;
	cursor: pointer;
	user-select: none;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: var(--wd-brd-radius, 4px);
	background: var(--wd-main-bgcolor, #fff);
	color: var(--wd-primary-color, inherit);
	font-weight: 600;
	font-size: 0.9rem;
	line-height: 1.2;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.lh-hero-picker__option:hover {
	border-color: rgba(0, 0, 0, 0.28);
}

.lh-hero-picker__option.is-selected {
	border-color: var(--wd-primary-color, currentColor);
	box-shadow: inset 0 0 0 1px var(--wd-primary-color, currentColor);
	background: rgba(0, 0, 0, 0.03);
}

.lh-hero-picker__option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.lh-hero-picker__check {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.1rem;
	height: 1.1rem;
	border: 1.5px solid rgba(0, 0, 0, 0.25);
	border-radius: 3px;
	background: #fff;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.lh-hero-picker__option.is-selected .lh-hero-picker__check {
	border-color: var(--wd-primary-color, currentColor);
	background: var(--wd-primary-color, #243b4a);
}

.lh-hero-picker__option.is-selected .lh-hero-picker__check::after {
	content: "";
	width: 0.32rem;
	height: 0.55rem;
	margin-top: -0.1rem;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.lh-hero-picker__option-text {
	display: block;
}

.lh-hero-picker__avatars {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
	gap: 0.65rem;
	margin-bottom: 0.75rem;
}

.lh-hero-picker__avatar {
	display: block;
	padding: 0.45rem;
	cursor: pointer;
	text-align: center;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: var(--wd-brd-radius, 0);
	background: var(--wd-main-bgcolor, #fff);
}

.lh-hero-picker__avatar.is-selected {
	border-color: var(--wd-primary-color, currentColor);
	box-shadow: inset 0 0 0 1px var(--wd-primary-color, currentColor);
}

.lh-hero-picker__avatar input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.lh-hero-picker__new {
	margin: 0.75rem 0 0;
}

.lh-hero-picker__new .btn {
	min-height: 0;
	padding: 0.4rem 0.9rem;
	font-size: 0.85rem;
}

.lh-hero-picker__avatar img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	margin-bottom: 0.35rem;
	border-radius: var(--wd-brd-radius, 0);
	background: var(--color-gray-100, #f7f7f7);
}

.lh-hero-picker__avatar span {
	font-size: 0.85rem;
	font-weight: 600;
}
