/**
 * GSL Chat Order — front-end.
 * Les couleurs, rayons, paddings et tailles sont ajoutés dynamiquement (wp_add_inline_style).
 */

.gsl-co-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 12px 0;
}

.gsl-co-buttons a.gsl-co-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	min-height: 42px;
	border: 0;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.gsl-co-buttons a.gsl-co-btn:hover,
.gsl-co-buttons a.gsl-co-btn:focus {
	text-decoration: none;
}

.gsl-co-buttons a.gsl-co-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.gsl-co-btn__icon {
	flex: 0 0 auto;
	width: 1.25em;
	height: 1.25em;
}

.gsl-co-buttons--disabled a.gsl-co-btn {
	opacity: 0.55;
	cursor: not-allowed;
}

/* -------------------------------------------------------------------------
 * Compatibilité WoodMart / WooCommerce : form.cart en flex, sur la même ligne
 * que la quantité, « Ajouter au panier » et « Acheter maintenant ».
 * ---------------------------------------------------------------------- */

.single-product div.product form.cart:not(.variations_form):not(.grouped_form):has(> .gsl-co-buttons),
.single-product div.product form.cart .woocommerce-variation-add-to-cart:has(> .gsl-co-buttons) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

form.cart .gsl-co-buttons--product,
form.cart .gsl-co-buttons--shortcode {
	display: inline-flex;
	flex: 0 1 auto;
	margin: 0;
}

form.cart .gsl-co-buttons a.gsl-co-btn {
	margin: 0;
}

/* Produits groupés : le bloc passe sous le tableau. */
form.grouped_form .gsl-co-buttons {
	flex-basis: 100%;
	margin-top: 10px;
}

/* Boucle produits. */
.gsl-co-buttons--loop {
	justify-content: center;
	margin: 8px 0 0;
}

/* Panier. */
.gsl-co-buttons--cart {
	margin-top: 12px;
}

.gsl-co-buttons--cart a.gsl-co-btn {
	flex: 1 1 100%;
}

/* -------------------------------------------------------------------------
 * Mode « commande uniquement par chat ».
 * ---------------------------------------------------------------------- */

body.gsl-co-chat-only div.product form.cart .single_add_to_cart_button,
body.gsl-co-chat-only div.product form.cart .wd-buy-now-btn,
body.gsl-co-chat-only .wd-sticky-btn .single_add_to_cart_button,
body.gsl-co-chat-only .wd-sticky-btn .wd-buy-now-btn,
body.gsl-co-chat-only .wd-sticky-btn-cart {
	display: none !important;
}

/* -------------------------------------------------------------------------
 * Mobile / desktop.
 * ---------------------------------------------------------------------- */

@media (max-width: 768px) {
	.gsl-co-hide-mobile {
		display: none !important;
	}

	.gsl-co-buttons.gsl-co-full-mobile,
	form.cart .gsl-co-buttons.gsl-co-full-mobile {
		display: flex;
		flex: 1 1 100%;
		width: 100%;
	}

	.gsl-co-buttons.gsl-co-full-mobile a.gsl-co-btn {
		flex: 1 1 100%;
		width: 100%;
	}
}

@media (min-width: 769px) {
	.gsl-co-hide-desktop {
		display: none !important;
	}
}

/* -------------------------------------------------------------------------
 * Toast.
 * ---------------------------------------------------------------------- */

.gsl-co-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 100000;
	max-width: calc(100% - 32px);
	padding: 12px 18px;
	border-radius: 8px;
	background: #1f2937;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 12px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.gsl-co-toast--visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

.gsl-co-toast--error {
	background: #b91c1c;
}

@media (prefers-reduced-motion: reduce) {
	.gsl-co-buttons a.gsl-co-btn,
	.gsl-co-toast {
		transition: none;
	}
}
