/**
 * Zonart B2B Access — Frontend styles
 *
 * Le filtre PHP woocommerce_get_price_html remplace normalement le prix par
 * un message. Mais certains thèmes (Enfold notamment) contournent cette
 * fonction pour les boucles produits. Le sélecteur ci-dessous sert de
 * fallback : il cache les éléments de prix qui n'auraient pas été interceptés.
 *
 * Note sur la spécificité : Enfold utilise #top .price span comme sélecteur
 * dans sa CSS, donc on ajoute html.zba- ou body[class*=...] pour le battre
 * au calcul de spécificité (et !important comme garde-fou).
 */

/* Cache tous les éléments de prix WooCommerce dans tout le site */
body.zba-prices-hidden .woocommerce-Price-amount,
body.zba-prices-hidden span.price > ins,
body.zba-prices-hidden span.price > del,
body.zba-prices-hidden p.price > ins,
body.zba-prices-hidden p.price > del,
html body.zba-prices-hidden #top .price span.woocommerce-Price-amount,
html body.zba-prices-hidden #top span.price .amount,
html body.zba-prices-hidden #top p.price .amount,
body.zba-prices-hidden .av-shop-price,
body.zba-prices-hidden .product .price ins,
body.zba-prices-hidden .product .price del,
body.zba-prices-hidden .products .price ins,
body.zba-prices-hidden .products .price del {
	display: none !important;
	visibility: hidden !important;
}

/* Si le prix a été remplacé par notre span (zba-price-hidden), on s'assure
   qu'il reste visible. Plus spécifique que les règles de masquage ci-dessus. */
body.zba-prices-hidden .zba-price-hidden,
html body.zba-prices-hidden #top .zba-price-hidden,
.zba-price-hidden {
	display: inline-block !important;
	visibility: visible !important;
	font-style: italic;
	color: #888;
}

/* Styles pour le bouton d'inscription qui remplace "Ajouter au panier" */
.zba-register-btn {
	display: inline-block;
}
.zba-product-register {
	margin: 16px 0;
}
.zba-product-register p {
	margin-bottom: 8px;
}

/* Message flash sur la page d'inscription */
.zba-flash-message {
	background: #fff8e1;
	border-left: 4px solid #f0b429;
	padding: 12px 16px;
	margin: 0 0 24px;
	color: #4a3300;
}

/* Résumé des profits B2B (panier, checkout, page commande, email) */
.zba-savings-summary {
	margin: 24px 0 0;
	padding: 16px 20px;
	border: 1px solid rgba(127, 127, 127, 0.25);
	border-radius: 6px;
	background: rgba(127, 127, 127, 0.05);
}

.zba-savings-summary__title {
	font-size: 0.95em;
	font-weight: 600;
	margin: 0 0 12px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	opacity: 0.85;
}

.zba-savings-summary__items {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.zba-savings-summary__item {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 6px 0;
	font-size: 0.95em;
	border-bottom: 1px solid rgba(127, 127, 127, 0.15);
}

.zba-savings-summary__item:last-child {
	border-bottom: none;
}

.zba-savings-summary__name {
	flex: 1 1 auto;
	min-width: 0;
}

.zba-savings-summary__qty {
	opacity: 0.6;
	font-size: 0.9em;
	margin-left: 4px;
}

.zba-savings-summary__value {
	flex: 0 0 auto;
	font-variant-numeric: tabular-nums;
	font-weight: 500;
}

.zba-savings-summary__total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding-top: 10px;
	margin-top: 4px;
	border-top: 1px solid rgba(127, 127, 127, 0.3);
	font-weight: 700;
	font-size: 1em;
}

.zba-savings-summary__total-value {
	font-variant-numeric: tabular-nums;
}

/* Colonne Profit dans le tableau Mes commandes */
.woocommerce-orders-table .order-zba-profit,
.woocommerce-orders-table th.order-zba-profit {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.zba-profit-cell {
	font-weight: 500;
}

.zba-profit-cell--empty {
	opacity: 0.4;
}

/* Total cumulé sous le tableau Mes commandes */
.zba-total-profits-cumulative {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 14px 18px;
	margin: 16px 0 24px;
	border: 1px solid rgba(127, 127, 127, 0.3);
	border-radius: 6px;
	background: rgba(127, 127, 127, 0.05);
	font-weight: 600;
}

.zba-total-profits-cumulative__label {
	font-size: 0.95em;
	letter-spacing: 0.02em;
}

.zba-total-profits-cumulative__value {
	font-variant-numeric: tabular-nums;
	font-size: 1.05em;
}
