/* ==========================================================================
   Smart Bi - Widget Add to Cart Variations
   Ce fichier gère uniquement la STRUCTURE et les ÉTATS (hover, disabled,
   loading, success). Les couleurs / bordures / espacements personnalisables
   sont injectées par Elementor via les contrôles de style (voir la classe
   du widget), donc on évite volontairement de fixer des couleurs en dur ici
   sauf valeurs de secours neutres.
   ========================================================================== */

.smartbi-vw-form {
	max-width: 100%;
}

.smartbi-vw-editor-notice {
	padding: 14px 16px;
	background: #fff4e5;
	border: 1px solid #f0c36d;
	color: #6a4a03;
	border-radius: 6px;
	font-size: 14px;
}

.smartbi-vw-attribute-row {
	display: block;
}

.smartbi-vw-attribute-label {
	display: block;
	font-weight: 600;
}

/* -------------------- Select natif WooCommerce -------------------- */

.smartbi-vw-native-select {
	width: 100%;
	max-width: 420px;
}

/* Mode 1 (boutons) : le select natif reste dans le DOM (WooCommerce s'en
   sert en interne pour détecter la variation) mais ne doit jamais être
   visible. */
.smartbi-vw-mode-buttons .smartbi-vw-native-select {
	display: none !important;
}

/* Mode 2 (liste déroulante) : c'est le select natif lui-même qui doit
   s'afficher, aucun bouton n'est rendu dans ce mode (voir le PHP). */
.smartbi-vw-mode-select .smartbi-vw-native-select {
	display: block !important;
	background-color: #fff;
	cursor: pointer;
}

/* -------------------- Mode 1 : boutons -------------------- */

.smartbi-vw-buttons {
	display: flex;
	flex-wrap: wrap;
}

.smartbi-vw-btn {
	flex: 1 1 calc((100% - (var(--smartbi-vw-per-row, 4) - 1) * 8px) / var(--smartbi-vw-per-row, 4));
	min-width: fit-content;
	background: #fff;
	border: 1px solid #ccc;
	cursor: pointer;
	text-align: center;
	white-space: nowrap;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
	padding: 10px 16px;
}

.smartbi-vw-btn.disabled {
	cursor: not-allowed;
	opacity: .6;
	text-decoration: line-through;
}

.smartbi-vw-btn.is-selected {
	font-weight: 600;
}

/* -------------------- Quantité -------------------- */

.smartbi-vw-quantity {
	display: flex;
	align-items: stretch;
	width: 100%;
	border: 1px solid #ccc;
	overflow: hidden;
}

.smartbi-vw-qty-btn {
	flex: 0 0 auto;
	background: transparent;
	border: 1px solid #cccccc;
	cursor: pointer;
	padding: 10px 18px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* WooCommerce enveloppe nativement le champ quantité dans son propre
   <div class="quantity">. On neutralise ce conteneur pour qu'il se
   comporte comme un simple bloc flexible centré, sans imbrication visuelle. */
.smartbi-vw-quantity .quantity {
	flex: 1 1 auto;
	display: flex;
	margin: 0;
	min-width: 0;
}

.smartbi-vw-qty-input {
	flex: 1 1 auto;
	width: 100% !important;
	min-width: 0;
	border: none !important;
	text-align: center;
	-moz-appearance: textfield;
	background: transparent;
	padding: 10px 0;
}

.smartbi-vw-qty-input::-webkit-inner-spin-button,
.smartbi-vw-qty-input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* -------------------- Bouton Ajouter au panier -------------------- */

.smartbi-vw-add-to-cart-wrap {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 16px;
}

.smartbi-vw-submit {
	position: relative;
	width: 100%;
	background: #111;
	color: #fff;
	border: none;
	cursor: pointer;
	padding: 14px 20px;
	font-weight: 600;
	transition: background-color .15s ease, color .15s ease;
}

.smartbi-vw-submit:disabled {
	cursor: not-allowed;
}

.smartbi-vw-btn-label {
	display: inline-block;
	vertical-align: middle;
}

/* Spinner de chargement */

.smartbi-vw-spinner {
	display: none;
	width: 16px;
	height: 16px;
	margin-left: 8px;
	border: 2px solid rgba(255, 255, 255, .35);
	border-top-color: #fff;
	border-radius: 50%;
	vertical-align: middle;
	animation: smartbi-vw-spin .7s linear infinite;
}

.smartbi-vw-submit.smartbi-vw-loading .smartbi-vw-spinner {
	display: inline-block;
}

.smartbi-vw-submit.smartbi-vw-loading .smartbi-vw-btn-label {
	opacity: .7;
}

@keyframes smartbi-vw-spin {
	to { transform: rotate(360deg); }
}

/* État succès (bref, après ajout réussi) */

.smartbi-vw-submit.smartbi-vw-success {
	pointer-events: none;
}

/* État "déjà dans le panier" */

.smartbi-vw-submit.smartbi-vw-in-cart {
	opacity: .9;
}

/* État rupture de stock (variation sélectionnée indisponible) */

.smartbi-vw-submit.smartbi-vw-out-of-stock {
	background: #999 !important;
	cursor: not-allowed;
}

.smartbi-vw-global-oos {
	font-style: italic;
}
