/* --- Conteneur principal --- */
.composite_wrap {
	background: #f9f9f9 !important;
	padding: 16px !important;
	border-radius: 12px !important;
	border: 1px solid #eee !important;
}

.msbd-cr-wrapper {
	display: grid;
	gap: 12px; /* Gap visible entre les slots */
}

/* Override Flatsome "form.cart > * { flex: 1 1 100%; margin: 0 }" which kills spacing between slots */
form.cart.msbd-cr-wrapper > .msbd-cr-slot {
	flex: none !important;
	margin-bottom: 10px !important;
}
form.cart.msbd-cr-wrapper > .msbd-cr-slot:last-of-type {
	margin-bottom: 0 !important;
}

/* --- Progress Bar --- */
.msbd-cr-progress[hidden] {
	display: none !important;
}

.msbd-cr-progress {
	padding: 0 0 16px 0;
	background: transparent;
	border: none;
	box-shadow: none;
}

.msbd-cr-progress-text {
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #555;
}

.msbd-cr-progress-bar {
	height: 6px;
	border-radius: 999px;
	background: #e0e0e0;
	overflow: hidden;
}

.msbd-cr-progress-fill {
	display: block;
	height: 100%;
	width: 0;
	border-radius: inherit;
	background: #4caf50;
	transition: width 0.25s ease;
}

/* --- Slots (Cards) — 2-row grid: number+image span both rows --- */
.msbd-cr-slot {
	padding: 14px 16px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
	transition: all 0.2s ease;
	display: grid !important;
	grid-template-columns: auto auto 1fr auto;
	grid-template-rows: auto auto;
	column-gap: 12px;
	row-gap: 6px;
	align-items: center;
}

.msbd-cr-slot--pending {
	border-color: #e5e5e5;
}

.msbd-cr-slot--selected {
	border-color: #4caf50;
}

.msbd-cr-slot--free {
	border-color: #fbc02d;
	background: #fffde7;
}

/* Header spans full width but is a grid subgrid container */
.msbd-cr-slot-header {
	display: contents;
}

.msbd-cr-slot-main {
	display: contents;
}

/* Numéro — spans both rows, col 1 */
.msbd-cr-number {
	grid-column: 1;
	grid-row: 1 / 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #f0f0f0;
	font-size: 14px;
	font-weight: 700;
	color: #888;
	align-self: center;
}

.msbd-cr-slot--selected .msbd-cr-number {
	background: #4caf50;
	color: #fff;
}

.msbd-cr-slot--free .msbd-cr-number {
	background: #4caf50;
	color: #fff;
}

/* Image — spans both rows, col 2 */
.msbd-cr-thumb {
	grid-column: 2;
	grid-row: 1 / 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 6px;
	background: #f5f5f5;
	overflow: hidden;
	align-self: center;
}

.msbd-cr-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Titre — row 1, col 3 */
.msbd-cr-copy {
	grid-column: 3;
	grid-row: 1;
	min-width: 0;
	align-self: end;
}

.msbd-cr-label {
	display: inline;
	font-size: 14px;
	font-weight: 600;
	color: #333;
	margin: 0;
}

/* Badge OFFERTE — row 1, col 4 */
.msbd-cr-offerte {
	grid-column: 4;
	grid-row: 1 / 3;
	align-self: center;
}

/* Dropdown — row 2, col 3-4 */
.msbd-cr-slot .component_inner {
	grid-column: 3 / 5;
	grid-row: 2;
	display: flex !important;
	align-items: center;
	padding: 0 !important;
	margin: 0 !important;
	align-self: start;
}

.msbd-cr-slot .component_selections {
	flex: 1;
	min-width: 0;
}

.msbd-cr-slot .component_options_select,
.msbd-cr-slot .variations select {
	width: 100%;
	height: 38px;
	min-height: 38px;
	padding: 0 12px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	background: #fff;
	font-size: 13px;
	color: #555;
	box-shadow: none;
}

.msbd-cr-slot .component_options_select:focus,
.msbd-cr-slot .variations select:focus {
	border-color: #4caf50;
	outline: none;
}

/* Badge quantité (x3) — fond noir, inline before title */
.msbd-cr-qty-badge {
	display: inline;
	padding: 2px 6px;
	border-radius: 4px;
	background: #1a1a1a;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	text-transform: uppercase;
	white-space: nowrap;
	vertical-align: middle;
	margin-right: 6px;
}

/* Badge Rupture de stock — inline with title */
.msbd-cr-oos-badge {
	display: inline;
	padding: 2px 8px;
	border-radius: 4px;
	background: #ffebee;
	font-size: 11px;
	font-weight: 600;
	color: #c62828;
	margin-left: 8px;
	white-space: nowrap;
	vertical-align: middle;
}

/* Blink animation */
@keyframes msbd-blink {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

/* Badge OFFERT — rouge, inline with title, clignotant */
.msbd-cr-offerte {
	display: inline;
	padding: 2px 8px;
	border-radius: 4px;
	background: #da3030;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	text-transform: uppercase;
	white-space: nowrap;
	vertical-align: middle;
	margin-left: 8px;
	animation: msbd-blink 1.5s ease-in-out infinite;
}

/* --- Nettoyage des éléments natifs WC --- */
.msbd-cr-slot .component_title_wrapper:not(.msbd-cr-slot-header),
.msbd-cr-slot .component_section_title,
.msbd-cr-slot .composited_product_title_wrapper,
.msbd-cr-slot .clear_component_options_wrapper,
.msbd-cr-slot .component_title,
.msbd-cr-slot .composited_product_image_container,
.msbd-cr-slot .composited_product_images,
.msbd-cr-slot .composited_product_image,
.msbd-cr-slot .component_option_image_container,
.msbd-cr-slot .component_option_images,
.msbd-cr-slot .image,
.msbd-cr-slot .composited-product-images,
.msbd-cr-slot > .component_inner .component_content > .image,
.msbd-cr-slot .composited_product_excerpt,
.msbd-cr-slot .composited_product_excerpt_wrapper,
.msbd-cr-slot .component_description_wrapper,
.msbd-cr-slot .component_data > a,
.msbd-cr-slot .component_wrap > .price,
.msbd-cr-slot .component_wrap > span.price,
.msbd-cr-slot .component_wrap .price,
.msbd-cr-slot .woocommerce-variation-price,
.msbd-cr-slot .single_variation .price,
.msbd-cr-slot .reset_variations,
.msbd-cr-slot .clear_component_options,
.msbd-cr-slot .component_option_actions,
.msbd-cr-slot .quantity_button,
.msbd-cr-slot .stock,
.msbd-cr-slot p.stock,
.msbd-cr-slot .in-stock,
.msbd-cr-slot .out-of-stock,
.msbd-cr-slot .woocommerce-variation-availability,
.msbd-cr-slot .woocommerce-variation-availability p,
.msbd-cr-slot .availability,
.msbd-cr-slot .component_wrap .stock,
.msbd-cr-slot .single_variation .stock,
.msbd-cr-slot .single_variation_wrap .stock,
.msbd-cr-wrapper .composite_navigation,
.msbd-cr-wrapper .composite_pagination,
.msbd-cr-wrapper .composite_status {
	display: none !important;
}

.msbd-cr-slot .component_options_inner,
.msbd-cr-slot .component_wrap,
.msbd-cr-slot .single_variation_wrap,
.msbd-cr-slot .component_summary,
.msbd-cr-slot .summary_content {
	padding: 0;
	margin: 0;
}

.msbd-cr-wrapper .composite_wrap > .composite_price,
.msbd-cr-wrapper .composite_price {
	position: absolute !important;
	visibility: hidden !important;
	height: 0 !important;
	overflow: hidden !important;
	pointer-events: none !important;
	clip: rect(0, 0, 0, 0) !important;
}

/* Force component_inner visible (WC hides it) */
.msbd-cr-slot .component_inner,
.msbd-cr-slot > .component_inner {
	display: flex !important;
}

/* Hide large product images WC shows for selected products */
.msbd-cr-slot .composited_product_details_wrapper > .composited_product_images,
.msbd-cr-slot .composited_product_details_wrapper > .image,
.msbd-cr-slot .composited_product_details_wrapper .product_image,
.msbd-cr-slot .composited_product_details_wrapper .product_thumbnail,
.msbd-cr-slot .component_content > .composited_product_images,
.msbd-cr-slot .component_content .composited_product_images,
.msbd-cr-slot .summary_content > .images,
.msbd-cr-slot .summary_content > .thumbnails,
.msbd-cr-slot .summary_content .composited_product_images,
.msbd-cr-slot .summary_content .product_image,
.msbd-cr-slot .summary_content > .description,
.msbd-cr-slot .summary_content > .product_excerpt,
.msbd-cr-slot .summary_content > .woocommerce-product-details__short-description,
.msbd-cr-slot .clear_component_options_wrapper,
.msbd-cr-slot .clear_component_options {
	display: none !important;
}

/* Hide variations table labels and extras */
.msbd-cr-slot .variations {
	margin: 0;
	border: 0;
}
.msbd-cr-slot .variations tbody,
.msbd-cr-slot .variations tr,
.msbd-cr-slot .variations td {
	display: block;
	width: 100%;
}
.msbd-cr-slot .variations .label {
	display: none;
}
/* Hide everything inside .component_data EXCEPT .variations table */
.msbd-cr-slot .details.component_data {
	padding: 0 !important;
}
.msbd-cr-slot .details.component_data > a,
.msbd-cr-slot .details.component_data > br,
.msbd-cr-slot .details.component_data > .component_wrap > .stock,
.msbd-cr-slot .details.component_data > .component_wrap > p.stock,
.msbd-cr-slot .details.component_data > .component_wrap > .quantity_button,
.msbd-cr-slot .details.component_data > .component_wrap > .woocommerce-variation-price,
.msbd-cr-slot .details.component_data > .component_wrap > .woocommerce-variation-availability,
.msbd-cr-slot .composited_product_title_wrapper,
.msbd-cr-slot .composited_product_title,
.msbd-cr-slot .component_wrap > .composited_product_title,
.msbd-cr-slot .single_variation_wrap .woocommerce-variation-description,
.msbd-cr-slot .single_variation_wrap .woocommerce-variation-price,
.msbd-cr-slot .single_variation_wrap .woocommerce-variation-availability {
	display: none !important;
}

/* Also hide the variation label row (e.g. "SAVEUR") — keep only the select */
.msbd-cr-slot .details.component_data .variations .label {
	display: none !important;
}
.msbd-cr-slot .component_content {
	margin-top: 0;
}
.msbd-cr-slot .composited_product_details_wrapper {
	display: grid;
	gap: 0;
}

/* --- Footer --- */
.msbd-cr-footer {
	margin: 0;
	padding: 0;
	border: none;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.msbd-cr-footer-copy {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.msbd-cr-footer-title {
	font-size: 12px;
	color: #888;
}

.msbd-cr-footer-prices {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.msbd-cr-footer-old {
	font-size: 14px;
	color: #999;
	text-decoration: line-through;
}

.msbd-cr-footer-current {
	font-size: 20px;
	font-weight: 800;
	color: #e53935;
}

.msbd-cr-footer-savings {
	background: #e8f5e9;
	color: #2e7d32;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	margin-left: auto;
	animation: msbd-blink 1.5s ease-in-out infinite;
}

/* --- Footer : Quantité + CTA --- */
.msbd-cr-wrapper .composite_button {
	display: flex !important;
	gap: 0;
	align-items: stretch !important;
	margin-top: 4px !important;
	padding-left: 0 !important;
	height: 44px;
}

.msbd-cr-wrapper .composite_button > *:not(:first-child) {
	margin-left: 12px;
}

body .msbd-cr-wrapper .composite_button .quantity {
	height: 44px !important;
}

body .msbd-cr-wrapper .composite_button .button.msbd-cr-cta {
	height: 44px !important;
	margin-right: 0 !important;
}

/* Overrides Flatsome stricts pour la quantité */
body .msbd-cr-wrapper .composite_button .quantity {
	display: flex !important;
	align-items: center !important;
	border: 1px solid #e0e0e0 !important;
	border-radius: 6px !important;
	background: #fff !important;
	height: 44px !important;
	padding: 0 !important;
	margin: 0 !important;
	flex: 0 0 auto !important;
}

body .msbd-cr-wrapper .composite_button .quantity input.qty {
	width: 40px !important;
	height: 100% !important;
	text-align: center !important;
	border: none !important;
	background: transparent !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	color: #333 !important;
	padding: 0 !important;
	margin: 0 !important;
	-moz-appearance: textfield !important;
}

body .msbd-cr-wrapper .composite_button .quantity input.qty::-webkit-inner-spin-button,
body .msbd-cr-wrapper .composite_button .quantity input.qty::-webkit-outer-spin-button {
	-webkit-appearance: none !important;
	margin: 0 !important;
}

body .msbd-cr-wrapper .composite_button .quantity .minus,
body .msbd-cr-wrapper .composite_button .quantity .plus {
	width: 36px !important;
	height: 100% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	background: transparent !important;
	border: none !important;
	color: #555 !important;
	font-size: 18px !important;
	cursor: pointer !important;
	box-shadow: none !important;
	min-height: 0 !important;
}

body .msbd-cr-wrapper .composite_button .quantity .minus:hover,
body .msbd-cr-wrapper .composite_button .quantity .plus:hover {
	background: #f5f5f5 !important;
}

/* CTA */
body .msbd-cr-wrapper .composite_button .button.msbd-cr-cta {
	flex: 1 !important;
	height: 44px !important;
	background: #4caf50 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 6px !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	text-transform: none !important;
	box-shadow: none !important;
	padding: 0 20px !important;
}

body .msbd-cr-wrapper .composite_button .button.msbd-cr-cta:hover {
	background: #43a047 !important;
}

@media (max-width: 849px) {
	/* Slots: dropdown full width under header */
	.msbd-cr-slot {
		grid-template-columns: auto auto 1fr !important;
		grid-template-rows: auto auto !important;
	}
	.msbd-cr-slot .component_inner {
		grid-column: 3 / -1 !important;
		grid-row: 2 !important;
		margin-left: 0;
		flex-direction: column;
		align-items: stretch;
	}

	/* Footer: title + savings on same line */
	.msbd-cr-footer-copy {
		display: flex !important;
		flex-direction: row !important;
		align-items: center !important;
		justify-content: space-between !important;
		flex-wrap: wrap !important;
		gap: 4px !important;
	}
	.msbd-cr-footer-title {
		flex: 0 0 auto;
	}
	.msbd-cr-footer-savings {
		margin-left: auto !important;
	}
	.msbd-cr-footer-prices {
		width: 100%;
	}

	/* Quantity + CTA: same row */
	.msbd-cr-wrapper .composite_button {
		flex-direction: row !important;
		align-items: stretch !important;
		height: 44px !important;
	}
	body .msbd-cr-wrapper .composite_button .button.msbd-cr-cta {
		flex: 1 !important;
		height: 44px !important;
	}
}