/* eConcepto Bons cadeaux : front
 *
 * Le formulaire reprend la typographie, les champs et les boutons du thème.
 * Seule la couleur d'accent est propre au plugin ; pour l'adapter au site,
 * ajoutez dans Apparence > Personnaliser > CSS additionnel :
 *   :root { --egc-accent: #6b8f7b; --egc-line: #d8d4c8; }
 */

/* ---- Formulaire produit ---------------------------------------------- */
.egc-form { margin: 0 0 1.5em; }

.egc-form .egc-heading {
	margin: 1.7em 0 .7em;
	font-size: 1.35em;
	line-height: 1.2;
}
.egc-form .egc-heading--first { margin-top: .4em; }

/* Montants : groupe de boutons joints (passe à la ligne si la colonne est étroite) */
.egc-amounts {
	display: flex;
	flex-wrap: wrap;
	max-width: 100%;
	background: #fff;
	border: 1px solid var(--egc-line, #d8d4c8);
	border-radius: 14px;
	overflow: hidden;
}
.egc-amount {
	position: relative;
	display: block;
	flex: 1 1 auto;
	margin: 0 -1px -1px 0; /* bordures partagées, rognées par overflow:hidden */
	padding: 0;
	background: #fff;
	border-right: 1px solid var(--egc-line, #d8d4c8);
	border-bottom: 1px solid var(--egc-line, #d8d4c8);
	cursor: pointer;
}
.egc-amount input { position: absolute; opacity: 0; pointer-events: none; }
.egc-amount__label {
	display: block;
	padding: 1.1em 1.5em;
	font-size: .95em;
	letter-spacing: .12em;
	white-space: nowrap;
	text-align: center;
	color: inherit;
	transition: background .15s, color .15s;
}
.egc-amount:hover .egc-amount__label { background: rgba(0, 0, 0, .035); }
.egc-amount input:checked + .egc-amount__label {
	background: var(--egc-accent, #6b8f7b);
	color: #fff;
}
.egc-amount input:focus-visible + .egc-amount__label {
	outline: 2px solid var(--egc-accent, #6b8f7b);
	outline-offset: -4px;
}
/* Neutralise les styles de boutons/étiquettes que certains thèmes appliquent aux <label> et <span> */
.egc-form .egc-amount__label *,
.egc-form .egc-amount__label bdi {
	display: inline;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
}
.egc-form label.egc-amount {
	display: block;
	width: auto;
	height: auto;
	border-width: 0 1px 1px 0;
	border-radius: 0;
	box-shadow: none;
}
.egc-form label.egc-amount:hover { background: #fff; }
.egc-form label.egc-amount .egc-amount__label { border: 0; border-radius: 0; box-shadow: none; }
.egc-custom-wrap { margin-top: .9em; max-width: 22em; }

/* Champs */
.egc-form .egc-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.1em 1.4em;
	align-items: start;
}
.egc-form .egc-field--full { grid-column: 1 / -1; }
.egc-form .egc-field label { display: block; margin: 0 0 .5em; font-weight: inherit; }
.egc-form input[type="text"],
.egc-form input[type="email"],
.egc-form input[type="number"],
.egc-form input[type="date"],
.egc-form textarea { width: 100%; box-sizing: border-box; }
.egc-form .egc-hint { display: block; margin: .45em 0 0; font-size: .85em; opacity: .7; }
.egc-form p.egc-hint { margin-top: -.5em; }
.egc-form .egc-counter { text-align: right; }

.egc-sr {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 640px) {
	.egc-form .egc-grid { grid-template-columns: 1fr; }
	.egc-amount__label { padding: 1em .9em; letter-spacing: .08em; }
}

/* ---- Panier / commande (si activé) ----------------------------------- */
.egc-box { margin: 0 0 1.5em; padding: 1em; border: 1px solid #ddd; border-radius: 4px; }
.egc-box-row { display: flex; gap: .5em; margin-top: .5em; }
.egc-box-row .egc-code-input { flex: 1; min-width: 0; }
.egc-message { margin-top: .5em; min-height: 1.2em; }
.egc-message.egc-ok { color: #2e7d32; }
.egc-message.egc-ko { color: #c62828; }

.egc-row .egc-remove { margin-left: .5em; font-size: .85em; font-weight: normal; }

/* ---- Compte client / solde ------------------------------------------- */
.egc-balance-result { margin: 1em 0; }
.egc-check-form { max-width: 28em; }

/* ---- Encart récapitulatif (mise à jour en direct) ---- */
.egc-recap {
	box-sizing: border-box;
	margin: 0 0 1.5em;
	padding: 1.4em 1.6em;
	border: 1px solid var(--egc-line, #d8d4c8);
	border-radius: 14px;
	background: #fff;
}
.egc-recap--under {
	position: relative;
	z-index: 1;
	clear: both;
	float: none;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 1.25em 0 0;
}
.egc-recap__title {
	font-size: .8em;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--egc-accent, #6b8f7b);
}
.egc-recap__amount {
	margin: .15em 0 .6em;
	font-size: 2em;
	line-height: 1.2;
	font-family: inherit;
}
.egc-recap__lines { margin: 0; }
.egc-recap__line {
	display: none;
	gap: .8em;
	padding: .35em 0;
	border-top: 1px solid var(--egc-line, #d8d4c8);
}
.egc-recap__line.is-filled { display: flex; }
.egc-recap__line dt {
	flex: 0 0 4.5em;
	margin: 0;
	font-weight: 600;
}
.egc-recap__line dd {
	margin: 0;
	min-width: 0;
	overflow-wrap: anywhere;
	white-space: pre-line;
}

/* Fiche bon cadeau : pas de catégorie (filet de sécurité si le thème l’affiche autrement) */
body.egc-product .product_meta { display: none !important; }
