/* ============================================================
   MB Subscriptions v3 — Page produit
   ============================================================ */

/* Masquer le sélecteur de variation WooCommerce et les pills legacy */
.mb-product-page .variations,
.mb-product-page .fg-variation-pills,
.mb-product-page table.variations {
	display: none !important;
}

/* ============================================================
   Case "Oui, je veux un abonnement"
   ============================================================ */

.mb-subscription-toggle {
	margin: 1em 0 1.25em;
	padding: 0.75em 1em;
	border: 1px solid #d3a84b;
	border-radius: 4px;
	background: #fffdf5;
}

.mb-subscription-label {
	display: flex;
	align-items: center;
	gap: 0.6em;
	cursor: pointer;
	font-size: 1em;
	color: #333;
	margin: 0;
}

.mb-subscription-label input[type="checkbox"] {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	cursor: pointer;
	accent-color: #3d1700;
}

.mb-subscription-label span {
	font-weight: 500;
}

/* ============================================================
   Overlay et boîte de dialogue
   ============================================================ */

#mb-fulfillment-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100000;
}

#mb-fulfillment-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

#mb-fulfillment-dialog {
	position: relative;
	background: #fff;
	border-radius: 8px;
	padding: 2em;
	max-width: 560px;
	width: calc(100% - 2em);
	margin: 8vh auto;
	max-height: 85vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#mb-fulfillment-dialog h3 {
	margin: 0 0 1.25em;
	font-size: 1.2em;
	color: #1a1a1a;
	padding-right: 1.5em;
}

/* Bouton fermer */
#mb-btn-close {
	position: absolute;
	top: 1em;
	right: 1em;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.25em;
	color: #666;
	line-height: 1;
	padding: 0.2em 0.4em;
}

#mb-btn-close:hover {
	color: #111;
}

/* ============================================================
   Bascule Cueillette / Livraison
   ============================================================ */

.mb-mode-toggle {
	display: flex;
	border: 1px solid #d3a84b;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 1.5em;
}

.mb-mode-btn {
	flex: 1;
	padding: 0.65em 1em;
	border: none;
	background: #fff;
	color: #555;
	cursor: pointer;
	font-size: 0.9375em;
	font-weight: 500;
	transition: background 0.15s, color 0.15s;
}

.mb-mode-btn + .mb-mode-btn {
	border-left: 1px solid #d3a84b;
}

.mb-mode-btn--active {
	background: #3d1700;
	color: #fff;
}

/* ============================================================
   Champs dans la modale
   ============================================================ */

.mb-field-label {
	display: block;
	margin: 1.1em 0 0.35em;
	font-weight: 600;
	font-size: 0.875em;
	color: #444;
}

.mb-select,
.mb-date-input,
.mb-postal-input {
	width: 100%;
	padding: 0.55em 0.75em;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.9375em;
	box-sizing: border-box;
	background: #fff;
	color: #222;
}

.mb-select:focus,
.mb-date-input:focus,
.mb-postal-input:focus {
	outline: none;
	border-color: #d3a84b;
	box-shadow: 0 0 0 2px rgba(211, 168, 75, 0.25);
}

/* Ligne code postal + bouton valider */
.mb-postal-row {
	display: flex;
	gap: 0.5em;
	align-items: stretch;
}

.mb-postal-row .mb-postal-input {
	flex: 1;
}

#mb-validate-postal {
	padding: 0.55em 1em;
	background: #d3a84b;
	border: none;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
	font-size: 0.9375em;
	font-weight: 500;
	white-space: nowrap;
	flex-shrink: 0;
}

#mb-validate-postal:hover {
	background: #b8912f;
}

/* Message retour validation code postal */
#mb-postal-message {
	font-size: 0.85em;
	margin-top: 0.4em;
	min-height: 1.2em;
}

/* ============================================================
   Erreur modale
   ============================================================ */

#mb-fulfillment-error {
	display: none;
	margin-top: 1em;
	padding: 0.625em 0.875em;
	background: #fff5f5;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	font-size: 0.875em;
	color: #b42318;
}

/* ============================================================
   Boutons d'action (Annuler / Confirmer)
   ============================================================ */

.mb-modal-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 1.5em;
	padding-top: 1.25em;
	border-top: 1px solid #eee;
	gap: 0.75em;
}

#mb-btn-cancel {
	padding: 0.65em 1.25em;
	background: #f5f5f5;
	border: 1px solid #ccc;
	border-radius: 4px;
	cursor: pointer;
	color: #444;
	font-size: 0.9375em;
}

#mb-btn-cancel:hover {
	background: #e8e8e8;
}

#mb-btn-confirm {
	padding: 0.65em 1.75em;
	background: #3d1700;
	border: none;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
	font-size: 0.9375em;
	font-weight: 600;
}

#mb-btn-confirm:hover {
	background: #5a2200;
}

#mb-btn-confirm:disabled {
	background: #999;
	cursor: not-allowed;
}

/* ============================================================
   Flatpickr dans la modale — positionnement
   ============================================================ */

#mb-fulfillment-dialog .flatpickr-calendar {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	margin-top: 0.5em;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
