/* Alexeo Broderie Prénom — fiche produit.
   Sélecteurs volontairement précis pour résister aux styles des thèmes / Elementor. */

/* Le formulaire d'ajout au panier de nombreux thèmes est en ligne (flex ou grille) :
   le bloc broderie passe sur sa propre ligne, quantité + bouton dessous.
   Le conteneur direct varie : form.cart (produit simple) ou
   .woocommerce-variation-add-to-cart (produit à déclinaisons) → on vise le parent direct, quel qu'il soit. */
form.cart:has(.abp-broderie),
:has(> .abp-broderie) { flex-wrap: wrap !important; align-items: center; }
.abp-broderie { flex: 1 0 100% !important; width: 100% !important; max-width: 100%; grid-column: 1 / -1; order: 0; }

.abp-broderie { box-sizing: border-box; margin: 0 0 1.25em; padding: 0; border: 0; text-align: left; }
.abp-broderie *, .abp-broderie *::before, .abp-broderie *::after { box-sizing: border-box; }

.abp-broderie .abp-broderie__title { margin: 0 0 .9em; font-weight: 600; }
.abp-broderie .abp-broderie__price { font-weight: 400; }
.abp-broderie .abp-broderie__optional { font-weight: 400; opacity: .7; }

.abp-broderie .abp-broderie__row { margin: 0 0 1.1em; padding: 0; width: 100%; }
.abp-broderie .abp-broderie__row label { display: block; margin: 0 0 .4em; }
.abp-broderie .abp-broderie__input { display: block; width: 100%; max-width: 360px; margin: 0; }
.abp-broderie .abp-broderie__help { display: block; margin-top: .4em; font-size: .85em; line-height: 1.4; opacity: .7; }

/* Couleurs */
.abp-broderie fieldset.abp-broderie__colors {
	display: flex; flex-wrap: wrap; gap: .5em;
	margin: 0; padding: 0; border: 0 !important; min-width: 0; background: none;
}
.abp-broderie .abp-broderie__colors legend {
	display: block; float: left; width: 100%; margin: 0 0 .5em; padding: 0; border: 0;
}
.abp-broderie .abp-broderie__colors legend + * { clear: left; }

.abp-broderie label.abp-broderie__swatch {
	position: relative; display: inline-flex !important; align-items: center; gap: .5em;
	width: auto; margin: 0; padding: .45em .9em .45em .5em;
	border: 1px solid rgba(0, 0, 0, .2); border-radius: 999px; background: #fff;
	cursor: pointer; line-height: 1.2; font-size: .95em; font-weight: 400;
	text-transform: none; letter-spacing: normal; white-space: nowrap;
	transition: border-color .15s, box-shadow .15s;
}
.abp-broderie label.abp-broderie__swatch:hover { border-color: rgba(0, 0, 0, .45); }

.abp-broderie .abp-broderie__swatch input[type="radio"] {
	position: absolute !important; top: 0; left: 0; width: 1px !important; height: 1px !important;
	margin: 0 !important; padding: 0 !important; opacity: 0 !important; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); appearance: none; -webkit-appearance: none;
}
.abp-broderie .abp-broderie__dot {
	display: inline-block; width: 20px; height: 20px; flex: 0 0 20px;
	border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25);
}
.abp-broderie .abp-broderie__name { display: inline; text-transform: none; }

/* Couleur sélectionnée (fonctionne même sans :has) */
.abp-broderie .abp-broderie__swatch input:checked + .abp-broderie__dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px currentColor; }
.abp-broderie .abp-broderie__swatch input:checked ~ .abp-broderie__name { font-weight: 700; }
.abp-broderie label.abp-broderie__swatch:has(input:checked) { border-color: currentColor; box-shadow: 0 0 0 1px currentColor; }
.abp-broderie .abp-broderie__swatch input:focus-visible + .abp-broderie__dot { outline: 2px solid currentColor; outline-offset: 4px; }

/* Phrases à broder */
.abp-broderie fieldset.abp-broderie__phrases {
	display: block; margin: 0 0 1.1em; padding: 0; border: 0 !important; min-width: 0; background: none;
}
.abp-broderie .abp-broderie__phrases legend { display: block; width: 100%; margin: 0 0 .2em; padding: 0; border: 0; }
.abp-broderie .abp-broderie__hint { margin: 0 0 .5em; font-size: .85em; font-weight: 600; opacity: .65; }
.abp-broderie label.abp-broderie__phrase {
	display: flex !important; align-items: center; gap: .6em; width: 100%;
	margin: 0; padding: .65em .25em; border-bottom: 1px solid rgba(0, 0, 0, .08);
	cursor: pointer; line-height: 1.3; font-size: .95em; font-weight: 600;
	text-transform: none; letter-spacing: normal;
}
.abp-broderie label.abp-broderie__phrase:first-of-type { border-top: 1px solid rgba(0, 0, 0, .08); font-weight: 400; }
.abp-broderie .abp-broderie__phrase input[type="radio"] {
	display: inline-block !important; visibility: visible !important; -webkit-appearance: radio; appearance: auto; position: static !important; opacity: 1 !important; clip: auto !important; clip-path: none !important;
	width: 16px !important; height: 16px !important; margin: 0 !important; flex: 0 0 16px; accent-color: currentColor;
}
.abp-broderie .abp-broderie__preview {
	margin: -.4em 0 1.1em; padding: .6em .8em; border-radius: 6px; background: rgba(0, 0, 0, .05); font-size: .95em;
}
.abp-broderie .abp-broderie__preview[hidden] { display: none; }
.abp-broderie label.abp-broderie__phrase:has(input:checked) { background: rgba(0, 0, 0, .04); }
.abp-broderie label.abp-broderie__phrase:has(input:checked) span { text-decoration: underline; text-underline-offset: 3px; }
