/* Breizh Mobile Colors — carrousel des couleurs + achat sous la photo.
 * Tout est caché hors mobile : sur ordinateur, le tableau reste affiché. */

.bmc-zone {
	display: none;
}

@media (max-width: 767px) {

	/* Le tableau reste dans la page (il fait le travail) mais n'est plus montré. */
	body.bmc-on .bmc-source {
		display: none !important;
	}

	/* Galerie : seulement la grande photo, on glisse pour voir les autres. */
	body.bmc-on .bmc-gallery .flex-control-nav {
		display: none !important;
	}

	body.bmc-on .bmc-gallery,
	body.bmc-on .bmc-gallery .woocommerce-product-gallery {
		margin-bottom: 0 !important;
		padding-bottom: 0 !important;
	}

	/* 10 px sous la grande photo (le script compense l'espace des colonnes Divi). */
	.bmc-zone {
		display: block;
		margin-top: 10px;
	}

	.bmc {
		margin: 0 0 12px;
	}

	.bmc-label {
		margin: 0 0 8px;
		padding: 0;
		font-size: 14px;
		line-height: 1.4;
	}

	.bmc-strip {
		display: flex;
		gap: 8px;
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-x: contain;
		touch-action: pan-x;
		scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding: 2px;
		margin: 0 -2px;
	}

	.bmc-strip::-webkit-scrollbar {
		display: none;
	}

	.bmc-item {
		position: relative;
		flex: 0 0 72px;
		width: 72px;
		height: 72px;
		padding: 0;
		margin: 0;
		border: 1px solid #e5e5e5;
		border-radius: 6px;
		background: #fff;
		overflow: hidden;
		scroll-snap-align: start;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		-webkit-user-select: none;
		user-select: none;
	}

	.bmc-item img {
		display: block !important;
		width: 100% !important;
		height: 100% !important;
		max-width: none !important;
		margin: 0 !important;
		object-fit: contain;
		pointer-events: none;
	}

	.bmc-item.is-selected {
		border-color: #000;
		box-shadow: inset 0 0 0 1px #000;
	}

	.bmc-item:focus-visible {
		outline: 2px solid var(--gcid-primary-color, #801818);
		outline-offset: 2px;
	}

	/* Couleur en rupture : vignette pâlie et barrée. */
	.bmc-item--oos img {
		opacity: 0.4;
	}

	.bmc-item--oos::after {
		content: "";
		position: absolute;
		left: -10%;
		top: 50%;
		width: 120%;
		border-top: 1px solid #999;
		transform: rotate(-45deg);
	}

	.bmc-buy {
		display: flex;
		gap: 8px;
		align-items: stretch;
		margin: 16px 0 0;
	}

	/* 16 px minimum : en dessous, iOS zoome sur le champ. */
	.bmc-qty {
		flex: 0 0 56px;
		width: 56px;
		margin: 0;
		padding: 0 4px;
		border: 1px solid #ccc;
		border-radius: 100px;
		background: #fff;
		font-size: 16px;
		text-align: center;
	}

	.bmc-add {
		flex: 1 1 auto;
		min-height: 48px;
		margin: 0;
		padding: 0.6em 1em;
		border: 1px solid #000;
		border-radius: 100px;
		background: #000;
		color: #fff;
		font-family: inherit;
		font-size: 16px;
		font-weight: 500;
		line-height: 1.3;
		cursor: pointer;
		transition: background-color 0.2s ease, color 0.2s ease;
	}

	.bmc-add:disabled {
		opacity: 0.5;
		cursor: not-allowed;
	}

	.bmc-qty:disabled {
		opacity: 0.5;
	}

	.bmc-msg {
		min-height: 1.2em;
		margin: 6px 0 0;
		padding: 0;
		font-size: 14px;
	}

	.bmc-msg--error {
		color: #a00;
	}
}
